|
|
|
|
|
|
PowerPoint
|
Make code run as slide show starts
|
|
Ease of Use
|
Intermediate
|
Version tested with
|
2002-2007
|
Submitted by:
|
John Wilson
|
Description:
|
A common problem in PowerPoint is getting code to run automatically as a slide show starts. Unlike other apps auto_open only works in AddIns.
|
Discussion:
|
Any situation where you want code to run at the start of a show.
|
Code:
|
instructions for use
|
Sub OnSlideShowPageChange()
Dim i As Integer
i = ActivePresentation.SlideShowWindow.View.CurrentShowPosition
If i <> 1 Then Exit Sub
MsgBox "Your code goes here"
End Sub
|
How to use:
|
- Open the VBE by pressing Alt f11
- Insert > a module
- Copy the code and Paste into the module
- Close the VBE
|
Test the code:
|
- Test the code by running the slide show.
- The message box will appear when slide 1 plays.
-
- Any code that you would like to run with the start of the show can be inserted instead of the msgbox.
-
- Note the code will run again if you return to slide 1. You could modify to make code run on a specific slide.
|
Sample File:
|
sample.zip 27.04KB
|
Approved by mdmackillop
|
This entry has been viewed 203 times.
|
|