Solved

Powerpoint Macro

Posted on 2011-02-20
5
963 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
  • 3
  • 2
5 Comments
 
LVL 23

Accepted Solution

by:
JSRWilson earned 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Microsoft Access 2010 Question 2 62
Office 2013 constant OST corruption 22 128
PowerPoint Links 7 38
In search of x17-22375.exe 2 13
PaperPort has a feature called the "Send To Bar". It provides a convenient, drag-and-drop interface for using other installed software, such as Microsoft Office. However, this article shows that the latest Office 2016 apps (installed with an Office …
No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
This video shows and describes the main difference between both orientations in Microsoft Word. Viewers will understand when to use each orientation and how to get the most out of them.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

910 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now