Macro to start a slideshow on the current slide

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'm new to using VB scripts and there something I need to do but can't
figure out how. I need to know the VB script to build a macro that will
start a PowerPoint slideshow on the current slide. It's basically like
clicking on the icon at the bottom left of PowerPoint.

Thanks to Wiz that will answer me.
 
I'm sure there is an easier way, but this seems to work:

Sub StartHere()
Dim starting As Long
starting = ActiveWindow.Selection.SlideRange.SlideIndex
ActivePresentation.SlideShowSettings.Run
ActivePresentation.SlideShowWindow.View.GotoSlide starting
End Sub

--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 
The reason why I need to do this is that I need the viewer to be able to
click on a link that will start a macro that would end the slideshow, select
an item in the slide, copy it and restart the slideshow on the same slide.

Using the codes you gave me, I've put up this macro. The macro is close to
being perfect but the problem is that it goes through slide 1 before heading
back to the slide from which the macro was activated. This results in the
viewer seeing slide 1 for a second or two. I would like to go around that if
at all possible and start the show straight from the current slide.

Sub CopyResults()
SlideShowWindows(Index:=1).View.Exit
ActiveWindow.Selection.SlideRange.Shapes("Rectangle 3").Select
ActiveWindow.Selection.Copy
Dim starting As Long
starting = ActiveWindow.Selection.SlideRange.SlideIndex
ActivePresentation.SlideShowSettings.Run
ActivePresentation.SlideShowWindow.View.GotoSlide starting
End Sub

Thanks a lot for your help!
 
In that case, I'm not sure why you have to exit the slideshow. Have you
tried:

ActivePresentation.SlideShowWindow.View.Slide.Shapes("Rectangle 3").Copy

That should copy the shape named Rectangle 3 on the current slide (it's
air code, so I probably made a mistake, but you get the idea).

--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 
And this is the difference between someone who has no clue (me!), and someone
who really knows what he's talking about (you!).

Thank you VERY much! This works perfectly!
 
That's the beauty of VBA. Yesterday, you had almost no clue. Today, you
have a little bit of a clue. Now you can do a little more. Keep asking
questions. You might want to check out the Programming PowerPoint section
of the PPT FAQ. It will give you lots of good pointers:

http://www.pptfaq.com/#name_PROGRAMMING_POWERPOINT

--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 
Back
Top