refering to shape that is grouped

K

KT

I have grouped a number of shapes together to form a
drawing_header shape master. The components of the
drawing_header shape are:
drawing_name;
drawing_version;
drawing_date; etc

I would like to refer to each of these shapes individually
not the drawing_header shape is a whole.

ActiveWindow.Page.Shapes("drawing_name") doesn't work.
ActiveWindow.Page.Shapes("drawing_header") gives me the
grouped shape.

I don't want to have to ungroup the drawing_header shape
because then it's no longer associated with the master.

How do I refer to the "drawing_name" component in VBA?

TIA.
KT
 
M

Mark Nelson [MS]

Visio requires shapes to be referenced by a unique name. You can use the
NameID of your shapes such as "Sheet.34". Find this under Format>Special.
You can also refer to your shapes by GUID. Custom names only work within
the same container, generally meaning the page. Shapes inside groups are
not in the page container and cannot be referenced by custom name.
 
K

KT

So how do I get the text property of the shape "Sheet.34"
then?
ActiveWindow.Shapes("Sheet.34").text doesn't work.

Shape "Sheet.34" is not unique to each page. In fact it's
present on every page in the document.

Where do I find the shape's GUID?

TIA.
KT
 
M

Mark Nelson [MS]

ActivePage.Shapes("Sheet.34").Text would work as long as such a shape exists
on the page. Otherwise go with Shape.UniqueID to use GUIDs.
 

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