Determining whether a PPT shape has other shapes within it

D

Dale Fye

I'm trying to write some code that will enumerate all of the shapes on a
slide.

Got this part working for the top level shapes, but if a shape is Group or a
diagram, or something else, how do I determine whether it has shapes
imbedded within it, and if so, how do I iterate through the shapes within
that higher level shape?

Dale
 
V

vindys

Dim s As Shape
Set s = ActiveWindow.Selection.ShapeRange(1)
If s.Type = msoGroup Then
With s
For i = 1 To s.GroupItems.Count
's.GroupItems (i) will give you each item
Next i
End With
End If
 
D

Dale Fye

Will this work for all types of shapes that have other shapes imbedded
within them, or only "Groups"?
 
D

Dale Fye

Steve,

Vindy's code below helped me crack the nut for Group types 8 and 13 and
appears to handle part of the issue with shape type (14, Diagram 4).

However, with the Diagram shape, although that code did allow me to delve
into the diagram, it did not identify the types of shapes that were embedded
in the diagram, and when I went into PPT and clicked on the diagram, there
did not appear to be a way to ungroup the shapes that make it up, to give me
access to the individual shapes.

I would be interested in knowing how to do this, as well as how to ungroup
embedded OLE Objects.

Once ungrouped, I can always close the presentation without saving the
changes, but I need to be able to diassemble the entire presentation so that
I can look at each of it's component parts.

Thanks for your help

Dale
 

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