how to obtain a shape object index, in a slideshowwindow.view

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How to return the shape object index in the macro program , when the
specified shape is clicked or the mouse pointer is positioned over the shape
during a slide show.
 
This should get you the index number. The name of the object is easier, but
might be duplicated within a slide. Just set the object's Action Setting to
run this macro.

Sub MyMacro(oShp As Shape)
With ActivePresentation. _
Slides(Activepresentation.SlideShowWindow _
.View.CurrentShowPosition)
For x = 1 To .Shapes.Count
If .Shapes(x).Id = oShp.Id Then
MsgBox "Shape Index = " & x
End If
Next x
End With
End Sub

--
Bill Dilworth, Microsoft PPT MVP
===============
Please spend a few minutes checking vestprog2@
out www.pptfaq.com This link will yahoo.
answer most of our questions, before com
you think to ask them.

Change org to com to defuse anti-spam,
ant-virus, anti-nuisance misdirection.
..
..
 
Wouldn't the following suffice?

Sub MyMacro(oShp As Shape)
MsgBox oShp.ZOrderPosition
End Sub
 
I thought I heard that the ZOrder could be changed without changing the
index. Of course, I do not remember the source where I heard that,
otherwise I could glare at them for a while.

As always, thank you Shyam,
Bill D.
 
Hi Bill,
The shape's position in the z-order always corresponds to the shape's index
number. So if you want to change the Index which is a read-only property,
you just have to change the zorderposition by using ZOrder method.


--
Regards
Shyam Pillai

Secure Pack: http://www.mvps.org/skp/securepack/
 
Back
Top