VBA: Given a PPT textrange, what slide is it on?

  • Thread starter Thread starter Dave Jenkins
  • Start date Start date
D

Dave Jenkins

Here's a textrange: Tell me what slide it's on.

I'm hoping the solution to this is easy, but I can't seem to dope it out:
Given an arbitrary textrange, I need to know the slide number on which that
textrange exists. And that's regardless of whether the textrange is part of
grouped shape, non-grouped shape, table cell (both PPT 2003 and 2007), ...

Thanks.
 
Use the parent object to do a reverse qualifying lookup to get the slide.

This will get the name of the slide for the selected text range.

?Activewindow.Selection.TextRange.Parent.Parent.Parent.Name
Slide1

Regards,
Shyam Pillai

http://skp.mvps.org
 
Back
Top