How do I know what slide is currently selected?

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.
 
J

John Wilson

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
 
B

Bill Dilworth

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
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top