GoTo Slide

  • Thread starter Thread starter Patrick D.
  • Start date Start date
P

Patrick D.

Hi

In PowerPoint 2007 I can jump to any slide with the VBA command
ActivePresentation.SlideShowWindow.View.GotoSlide (2)

As soon as I insert further slides, the slide-numbers wont be the same.
What is the easiest way to ALWAYS jump to the correct slide?

Patrick
 
If you know the SlideID of the target slide you can use something like this
(assuming ID = 257)

Sub jump_To_ID()
Dim I_ID As Integer
I_ID = ActivePresentation.Slides.FindBySlideID(257).SlideIndex
SlideShowWindows(1).View.GotoSlide (I_ID)
End Sub

You can find the SlideID of a slide with

MsgBox ActiveWindow.View.Slide.SlideID

or there's a routine here to temporarily print the ID 's on all your slides

http://www.pptalchemy.co.uk/PowerPoint_vba_SlideID.html
--
john ATSIGN PPTAlchemy.co.uk
Custom vba coding and PPT Makeovers
Free PPT Hints, Tips and Tutorials
http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html
PPTLive Atlanta 2009
 
Another option is to name the slide and then:

ActivePresenation.SlideShowWindow.View.GotoSlide _
ActivePresenation.Slides("The Slide Name").SlideIndex

Just replace The Slide Name with whatever you named the slide. You can use
the routines in Example 8.7 on my site to find or set the name of the slide
(http://www.PowerfulPowerPoint.com/).

--David

--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland
 
Oh give me strength. Why is power[point so damn hard? Why do I have to wonder about hidden identifiers and the like? On my design screen I see slide numbers and names. Why can't I use a macro to easily jump to a slide by name, in presentation mode?

I'm trying to show an interactive screen to the public on a touchscreen. An index of surnames going to a group photo when they touch the name. Hyperllinks are crap - I run out of space. I have now spent the best part of 5 hours scouring the internet for macro code that will do this for me. I have 3,000 such links to enter, so I presume that's 3,000 macros. a sadist must have written this crap they call powerpoint.
 
Back
Top