?
Solved

Powerpoint Macro

Posted on 2011-02-20
5
Medium Priority
?
979 Views
Last Modified: 2012-06-27
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
Comment
Question by:KCTS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 23

Accepted Solution

by:
JSRWilson earned 2000 total points
ID: 34937567
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
 
LVL 70

Author Comment

by:KCTS
ID: 34940993
Thats great - can you please explain what the difference is between next/previous build and next/previous slide ?
0
 
LVL 23

Expert Comment

by:JSRWilson
ID: 34941596
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
 
LVL 70

Author Comment

by:KCTS
ID: 34941698
Thanks for that clarification.

0
 
LVL 70

Author Closing Comment

by:KCTS
ID: 34941707
Excellent answer with detailed explanation
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
This article describes a serious pitfall that can happen when deleting shapes using VBA.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question