need a method to globally update shapes info

S

sgopus

I have created a multiple paged viso doc reflecting
servers mounted in racks, each shape is linked to a
database, move the cursor over the shape and it displays
the data off to the left.
My problem is this, after the viso doc is finished, along
comes my manager and decides we need additional fields
in the database and we also need to reflect this new info
in the visio doc, I have over 300 shapes, other than
individually going thru each shape and relinking to the
database, is there a way to globally refresh the shapes
and pick up the new fields, or for that matter page by page
rather than shape by shape??
 
A

Al Edlund

when you drop a shape onto a document it first is dropped onto the document
stencil and then from there onto the page. I would first try updating the
shape in the docoument stencil.
al
 
S

sgopus

Here is the interesting part.
I have customized a server shape to suit our purposes.
So it no longer matches the stencil shape of server.
What we have done is to just copy the custom shape and
paste it when a new server is installed.
Then link it to the proper server name in the database.
it works great for new servers all fields are shown.
the problem is the shapes already in place, how do we
update the fields globally instead of individually,
This is alot of shapes 300 or so, gotta be an easier way!
 
A

Al Edlund

Well the good news is that it can be done rather simply in VBA and the
basics of what you need are in the Visio SDK (i.e. adding custom properties
to shapes).
Al
 
S

sgopus

I've looked there and tried defining custom properties
it seems to only apply them to one shape, not an entire
page, can you give me a step by step example.

other problems I've encountered, the fields in the database
are picked up out of order, I've numbered them so they can
be sorted via numerical order ie 01name 02ipaddress etc.
It gets them 01 02 03 04 then goes to 11 12 13 14 then
goes back to 05 06 07 , real puzzler..
 
A

Al Edlund

well the easy one first. the numbers aren't read numerically but rather
alphabetically.


For iPagCtr = 1 To visDocument.Pages.Count
' we dont want to include the background slides
If visDocument.Pages(iPagCtr).Background = False Then
for iShpCtr = 1 to ActivePage.Shapes.Count

' test for the right shape
' add custom properties

next iShpCtr
End If ' test for background
Next iPagCtr

Al
 
M

Mark Nelson [MS]

If your goal is to get the same set of custom properties on a bunch of
shapes, use the Custom Property Sets feature. Find it in the Tools menu for
Visio 2003 or buried under Tools > Macros > Visio Extras for Visio 2002.
 
S

sgopus

The goal is this, we have approx 300+ shapes in this visio
doc, and on occasion we find it necessary to add fields
for new data in our database, (so far) in order to reflect
the new fields in the data shown on the server shapes,
we have to highlight each shape and relink to the database
and delete all the old fields, then add all the fields
to get the proper order, else it picks them up out
of order, when your talking 300+ shapes and more added
each day, that's a bunch of work, for new fields.
We want to find a way to globally add the new fields
to the shapes and in the correct order, we have them
numbered in the database, so they are sorted properly.

You would think this would be something easy, it even
mentions it in the help file, but the instructions don't
do what they say, each case is unique I guess.
also I'm not a Vbasic programmer, barely a novice in Vbasic
 
S

sgopus

Further:
Yes we have done the custom properties thing, works great
for new shapes, but not for the old ones.
 
S

sgopus

Well If I knew that, I wouldn't be asking the question
here! I could resolve it on my own!

It appears that new shapes pick up all the fields in
proper order, the old shapes just add the fields , but not
in the proper order, nor does it allow for a global update
it only allows each individual shape one at a time!

I think I'll just deal with it, and update each shape one
at a time, the time I've spent researching this, I could
have been doing the updates and had it done by now..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top