Keeping track of shapes on pages Question

M

Matt B

I am using a Visio project with about 20 pages of shapes plus some VBA
forms.
I have found when shapes are dropped on pages their names are unique to each
page but shapes with the same names may exist on other pages. Eg. (Custom.22
exists on page 2 and page 3). All shapes are linked to an access database.

If I wish to get a shape at a later date I require not only the shape name
but its page. Is there a way (VBA method) to address / get shapes without
specifying the page? At the moment I have a 'page' field in my database for
each shape. A field also stores the shape name. Is their a way to make shape
names unique to the entire document, not only the page?

Would I be better off using a GUID to address / manage shapes and can this
be done in VBA?
 
A

Al Edlund

I use the something like this when I drop something on a page.

strShapeUniqueID = visShape.UniqueID(visGetOrMakeGUID)

So the short answer is yes GUIDs do make sense when coordinating between a
document and a database. I also create a GUID for each page and store it in
a page Custom Propety and page record in the database, as well as the object
record that has just been dropped.

Al
 

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