How do I know what slide is currently selected?

  • Thread starter Thread starter Jonas
  • Start date Start date
J

Jonas

I'm working on a PowerPoint add-in where I want to add a new (special) slide
after the currently selected slide. Is there any way to find out what slide
is currently selected using the PowerPoint object model? I have looked and
could not find any way of doing it... I hope I have missed something.
 
Maybe something based on:

Sub whichslide()
Dim n As Integer
On Error GoTo errhandler
n = ActiveWindow.Selection.SlideRange(1).SlideIndex
With ActivePresentation.Slides(n) '(n+1)??
'do this
End With
Exit Sub
errhandler:
MsgBox "Is a slide selected"
End Sub
--
Amazing PPT Hints, Tips and Tutorials

http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk
 
He may mean during an active show, in which case ...

Sub HereAfter()

With ActivePresentation.Slides _
.Add(Index:= ActivePresentation.SlideShowWindow _
.View.CurrentShowPosition +1, Layout:=ppLayoutBlank)
'Do stuff to the slide
End With

End Sub


Depends on what he's here after.

--
Bill Dilworth
A proud member of the Microsoft PPT MVP Team
Users helping fellow users.
http://billdilworth.mvps.org
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
vestprog2@ Please read the PowerPoint FAQ pages.
yahoo. They answer most of our questions.
com www.pptfaq.com
..
 
Back
Top