Microsoft KB Archive/261178

= PPT2000: Sample Macro for Generic Previous Slide Transition with Animations =

Article ID: 261178

Article Last Modified on 10/11/2006

-

APPLIES TO


 * Microsoft PowerPoint 2000 Standard Edition

-



This article was previously published under Q261178



SUMMARY
The sample code in this article creates a single action button on the master slide of the presentation, which allows you to go backward through your presentation, restarting the animations on the previously viewed slides.



MORE INFORMATION
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. NOTE: The following macro examples work only in PowerPoint. Visual Basic for Applications macros are not supported by the Microsoft PowerPoint Viewer. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

Code Sample
Sub GoPrevSlide Dim lSlide As Long

' Get the current slide position in the slide show. '       lSlide = SlideShowWindows(1).View.CurrentShowPosition

' If the current position is slide 1 of the presentation, ' then set lSlide to the last slide position. Alternately, ' you could set lSlide to 2, which prevents it from ' &quot;wrapping&quot; or &quot;looping&quot; in reverse. Setting it to 2 ' causes it to stay in place. Or, you can subsititute the ' the following line of code in place of the current Then ' statement: ' '       SlideShowWindows(1).View.Exit ' ' This ends the show if you try to go past slide 1 ' backward. '       If lSlide = 1 Then lSlide = ActivePresentation.Slides.Count Else:

' Set lSlide to the index position previous to the ' current slide.

lSlide = lSlide - 1 End If

' Go to the slide indicated by lSlide and start the ' animations on that slide. '       SlideShowWindows(1).View.GotoSlide lSlide, msoTrue End Sub

Adding and Configuring an Action Button to the Slide Master
 On the View menu, point to Master, and then click Slide Master. To create an action button, follow these steps:  On the Drawing toolbar, click AutoShapes, point to Action Buttons, and then click the Action Button: Custom button. Draw the action button on the master slide.  In the Action Settings dialog box, click the Mouse Click tab. Click Run macro.</li> In the list of macros, click the GoPrevSlide macro.</li> Click OK.</li> On the View, click Normal to return to the slide view.</li></ol>

<div class="references_section">