Steve
Tue May 06 12:02:35 CDT 2008
In article <ewXoej4rIHA.672@TK2MSFTNGP02.phx.gbl>, Shyam Pillai wrote:
> Candace,
> FYI: PPT 2007 Z-Orderposition property has a bug.
>
> If a slide has 2 shapes, the 1st being - a group containing 2 autoshapes
> then the z-order position of the 2nd shape on the slide in PPT 2003 is 2 but
> in PPT 2007 it is 3. Now, it would be fine if PPT 2007 handled this change.
> But it does not, so now if you attempt to get reference to the 2nd shape
> using the z-order value returned it will throw an error.
<SpockTalk>
Interesting.
But is it logical, Captain?
Have you reported this anomaly to StarFleet/Redmond?
</SpockTalk>
The Z-order then reflects the way tabbing through the shape collection works.
So the WAR would be using shape names, shape tags (and both of those seem to
have their own problems in 2007).
Or iterate through the shapes with something like this (but see notes after):
Sub ShowZOrder()
Dim oSh As Shape
For Each oSh In ActivePresentation.Slides(1).Shapes
If oSh.Type = msoGroup Then
Debug.Print "GROUP at ZOrder: " & oSh.ZOrderPosition
Call HandleGroups(oSh)
Else
Debug.Print oSh.ZOrderPosition
End If
Next
End Sub
Sub HandleGroups(oGrpShape As Shape)
Dim oSh As Shape
For Each oSh In oGrpShape.GroupItems
If oSh.Type = msoGroup Then
Debug.Print "GROUP at ZOrder: " & oSh.ZOrderPosition
Call HandleGroups(oSh)
Else
Debug.Print oSh.ZOrderPosition
End If
Next
End Sub
===========
But that triggers another bug (one that also reflects the way tabbing order
works).
If you group two shapes, draw another shape, then group the group plus the new
shape:
Group2:
Group1:
Shape1
Shape2
Shape3
then tabbing through the shapes selects the "outer" group (Group2) then each
shape within the group, but NOT Group1.
>
> Regards,
> Shyam Pillai
>
> Image Importer Wizard
>
http://skp.mvps.org/iiw.htm
>
> "Candace" <Candace@discussions.microsoft.com> wrote in message
> news:6FAF697F-8FC7-466F-9B7B-4A7B542384F3@microsoft.com...
> > I'm using PPT 2007. I need to verify that I am referencing shapes and
> > slides
> > by their correct number in my vba code. For the slide number, I am looking
> > at
> > the slide number listed in the status bar in normal view of the slideshow.
> > For the shapes, I am looking at the number listed in the custom animation
> > pane for that shape or action button. Is this correct? I think I might be
> > using the wrong numbers in code, because I'm getting a message that says:
> > "Shapes(unknown member): Integer out of range. 15 is not in the valid
> > range
> > of 1 to 13."
>
-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================