Solved

Powerpoint Macro

Posted on 2011-02-20
5
959 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

The new Microsoft OS looks great, is easier than ever to upgrade to, it is even free.  So what's the catch?  If you don't change the privacy settings, Microsoft will, in accordance with the (EULA) you clicked okay to without reading, collect all the…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This video walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

706 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

19 Experts available now in Live!

Get 1:1 Help Now