Visio 2003: Scan shapes and obtain subshape names???

G

Guest

Hi I need to scan all of the shapes in a stencil, and obtain the shape
names. Not only the shape names I also need to obtain the names of the
subshape names (for the grouped shapes).
I can obtain the shape names with the following code. What is the best way
to obtain the subshape names? I think I should do this recursively...

Set objStencil = Application.Documents.OpenEx(strFilename, visOpenRO +
visOpenHidden)
For intCounter = 1 To objStencil.Masters.Count
Debug.Print " "; objStencil.Masters.Item(intCounter).Name
Next intCounter

Any help is appreciated!
 
J

JuneTheSecond

Shape.Shapes property would get child shapes in the group, for example;
For Each mst In objStencil.Masters
Debug.Print " "; mst.Name
If mst.Shapes.Count > 1 Then
For Each shp In mst.Shapes
Debug.Print " " & shp.Name
If shp.Shapes.Count > 0 Then
For Each shp2 In shp.Shapes
Debug.Print " "; shp2.Name
Next
End If
Next
End If
Next
 

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