PPT VBA: How to get "grandparent" group? (PPT crashes)

  • Thread starter Thread starter Gary McGill
  • Start date Start date
G

Gary McGill

Hi,

I'm using PPT 2003 SP1 and am trying to figure out how to navigate "up" the
group hierarchy in VBA when I have a group that includes another group.

For example, suppose I take a text box and group it with an autoshape. Now
suppose I take that group and group it with another autoshape, so that (to
my mind, anyway), I have a 2-level hierarchy as follows:

grandparent group
autoshape
parent group
autoshape
textbox

If I get a reference to the textbox shape, then I can navigate to the
"parent group" using the ParentGroup method.

I'd expect to be able to do the same to get to the "grandparent group", and
certainly the Child property of the "parent group" is True, which suggests
that I should. However, when I try to access the ParentGroup property of the
"parent group", PowerPoint crashes. :-(

Is there an alternative way to do this?

Gary
 
In PowerPoint 2003, you get only a 2-level hierarchy irrespective of how
many levels we group the shapes. When you get the children nodes of
grandparent group, you get all the shapes across all levels within the
group.

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html
 
Thanks, but I still don't understand how to access the group object. If I
have a reference to the textbox shape in the example below, using the
ParentGroup property seems to return me an object reference that crashes
PowerPoint almost every time I use it...? Also, the GroupItems property of
that object cannot be accessed - I get an error saying it can only be used
for a group(!).

Does anyone have some sample code showing how to navigate around groups?

Thanks again,
Gary
 
Back
Top