• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 984
  • Last Modified:

Powerpoint Macro

I need to be able to move forward and backward in the slide show

I have managed to work out that  

ActivePresentation.SlideShowWindow.View.Next
and
ActivePresentation.SlideShowWindow.View.Previous

will move forward and back one slide

can anyone tell me the code required to

a) Move forward 2 slides  (eg if on slide 2 go to slide 4, if on slide 3 to to slide 5) - it needs to be generic and work on any slide
b) Move back 2 slides opposite of above
c) determine which number slide is currently displayed
d) determine number of slides in the presentation

Many thanks
0
KCTS
Asked:
KCTS
  • 3
  • 2
1 Solution
 
JSRWilsonCommented:
First of all that's not exactly what they do - it moves to the next / previous build (not the same thing)

Here's what you need:


Sub Report_In()
Dim lngNum As Long
lngNum = ActivePresentation.SlideShowWindow.View.CurrentShowPosition
'forward 2
ActivePresentation.SlideShowWindow.View.GotoSlide (lngNum + 2)
'back 2
ActivePresentation.SlideShowWindow.View.GotoSlide (lngNum - 2)
'current slide
MsgBox "You are on slide " & lngNum
'Number of slides
MsgBox "There are " & ActivePresentation.Slides.Count
End Sub

Open in new window

0
 
KCTSAuthor Commented:
Thats great - can you please explain what the difference is between next/previous build and next/previous slide ?
0
 
JSRWilsonCommented:
If you have a slide with say six animations (on click) and you are animation 4. Then the next build is animation 5 NOT the next slide.

If there are no animations then you will always go to the next slide
0
 
KCTSAuthor Commented:
Thanks for that clarification.

0
 
KCTSAuthor Commented:
Excellent answer with detailed explanation
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now