PDA

View Full Version : Simulate a "Back" navigation button



slang
12-10-2009, 10:46 AM
Hello all, Really new to VBA in PPT and it looks a lot different than Excel:help

I want to have a macro that I can attach to a "Back" button object that will navigate back to the last viewed slide, but, wait for it..... that has at least a 10 slide history associated with it.:think:

I would put the same "Back" object on every slide linked to the macro so when clicked it would navigate back to the next previously viewed slide in the history.

Where to start, where to start??? :help
Powerpoint 2003

Thanks for any help you can give.
</IMG>

Cosmo
12-10-2009, 03:08 PM
Hello all, Really new to VBA in PPT and it looks a lot different than Excel:help

I want to have a macro that I can attach to a "Back" button object that will navigate back to the last viewed slide, but, wait for it..... that has at least a 10 slide history associated with it.:think:

I would put the same "Back" object on every slide linked to the macro so when clicked it would navigate back to the next previously viewed slide in the history.

Where to start, where to start??? :help
Powerpoint 2003

Thanks for any help you can give.
</IMG>

This can be done, but it could get a bit tricky depending on how you navigate through the document. Do you only use buttons to advance through the slides, or can the user use the default mouse click to advance slides.

You can set up a global array to hold the last 10 slide numbers, and whenever you advance slides, add the current slide number to the top of the list, and drop the 11th slide number. The back button would go to the previous and drop the top number.

If you only allow advancing thorugh buttons, you could have them run a macro to do this, but if you allow the user to advance through the built-in methods (mouse click, using the slide menu at the lower left, or typing the slide number and pressing the enter key) then you need to build the array when the slide changes, and this is a lot more involved.

Paul_Hossler
12-11-2009, 07:04 PM
If

1. I'm understanding what you want (go back one at a time?)
2. Remembering how 2003 worked (I only have 2007 now)

.. on the master slide I used to put an Action Button to go to the previous slide (also did other things on the master).

Never needed VBA just for that

This is a 2007 version backsaved to 2003, so it's "probably" OK

Paul

Cosmo
12-12-2009, 09:14 AM
If

1. I'm understanding what you want (go back one at a time?)
2. Remembering how 2003 worked (I only have 2007 now)

.. on the master slide I used to put an Action Button to go to the previous slide (also did other things on the master).

Never needed VBA just for that

This is a 2007 version backsaved to 2003, so it's "probably" OK

Paul
That will not do what the user wants. If you start on slide 1, then go to slide 3, then slide 5, your button will take them to slide 4 since you used "Previous Slide". Setting the action to go to "Last Viewed Slide" would be closer to what the user wants, as it would take the user back to slide 3, but since it only remembers the last slide, and not the history, clicking on the back button from there would take you to slide 5 again (since that was the 'last viewed') and not back to slide 1, which was the slide viewed in the history before slide 3.

Paul_Hossler
12-12-2009, 09:54 AM
Oh, well ... I should have been worried when it seemed too easy :aw

BTW, 'Last Viewed Sldie' in 2007 seems to take me to the Next Slide.

I changed the action button to LVS, started with #1, then #2, jumped to #4, but the action button jumped me to #5.

Paul

John Wilson
12-12-2009, 10:44 AM
This is only possible with vba and it's not easy!
First you need to run the record macro when the slideshownextslide event happens. Events are MUCH harder in PPT than in Excel!

Second you need to record the slide to a Public Array as Cosmo said

Third Track back using the array and delete the last array member.

3a DON'T record the slides when the back button is used. (Think about this)

Demo (not fully thought out but should be a pointer) attached

Click the red arrow (just once) to start recording, change slides a few times, click back to backtrack

Emperor
12-16-2009, 05:43 AM
Isn't it possible for you to just use 'custom show' (i think this is the correct term, my pp is in dutch ^^)
This way you can select wich sheets to use in the show, when you click back in will look in your custom show?

Cosmo
12-16-2009, 06:34 AM
Isn't it possible for you to just use 'custom show' (i think this is the correct term, my pp is in dutch ^^)
This way you can select wich sheets to use in the show, when you click back in will look in your custom show?
Not exactly the same thing, although depending on the situation, custom shows may give something similar to what the user wants. If the presentation is broken down into sections, and each section is a custom show, then you can return to the slide that called that show. I use them a lot like this (currently working on one now which may have as many as 30 custom shows*), but it is not a true 'back' navigation system as was requested as it doesn't return to the previously viewed slide, only to the slide which called the custom show.


* I really hope that MS revamps the interface for editing custom shows in the next version (although I doubt they will); or that I get the time to work on the VBA custom show editor that I had been playing around with a while ago. Right now, neither option seems too promising to me. :(