Log in

View Full Version : Need a "Return" button



chanteur
01-23-2010, 11:25 AM
Okay, I'm at slide 5 and I have a button that will take slide 10. Now I want to return to slide 5. Then I go to slide 6 and press the button that will take me to slide 10 again. Then I'd like to return to slide 6. I can easily get to slide 10 from any slide:

Private Sub block_diagram_Click()
ActivePresentation.SlideShowWindow.View.Slide10
End Sub

What I need is a basic VBA script for a "Return" button that will return me to any slide I went to slide 10 on.

Thanks:banghead:

Paul_Hossler
01-23-2010, 01:57 PM
At least in 2007, and as I recall similar in 2003, Insert, Shapes, Action Button, and then draw the 'Return' button on Slide 10.

It takes you back to the last slide viewed.

Paul

John Wilson
01-23-2010, 11:03 PM
First vba in NOT necessary either to goto 10 or to take you back just use the action setting

Hyperlink to Slide (10)
Hyperlink to "Last Slide Viewed"

If for some reason you NEED to use vba the code would be

Sub go_back()
With SlideShowWindows(1).View
.GotoSlide (.LastSlideViewed.SlideIndex)
End With
End Sub

chanteur
01-24-2010, 10:12 AM
Many thanks, John!

All I had to do ito get it to work was to change:

With SlideShowWindows(1).View
.GotoSlide (.LastSlideViewed.SlideIndex)

to:

With ActivePresentation.SlideShowWindow.View
.GotoSlide (.LastSlideViewed.SlideIndex)