Header
PowerPoint tips, hints and tutorials that will change your presentations for ever!

INDEX

 

Jigsaws
Sounds
Video
Custom Shows
vba code
NaviSlides
Games for teachers
Bullets
Triggers
Security
Flash Cards
Multiple Instances
PowerPoint 2007
Mail Merge
Random events
Animation
Hyperlinks
Set spellcheck language


Home buttonTutorial buttonContact buttonProducts button


Code That Runs When The Show Begins

This is often asked as a question and surprisingly it is very difficult to achieve,

Here is one way that works in 2007 and 2010 only.

It is often suggested that the pseudo event OnSlideShowPageChange can be used. Typical code would be:

Sub OnSlideShowPageChange(ByVal SSW As SlideShowWindow)
If SSW.View.CurrentShowPosition = SSW.Presentation.SlideShowSettings.StartingSlide Then
'PUT CODE HERE
End If
End Sub

To run on a particular slide instead of the start

Sub OnSlideShowPageChange(ByVal SSW As SlideShowWindow)
If SSW.View.CurrentShowPosition = SSW.Presentation.Slides(x).SlideIndex Then
'PUT CODE HERE
End If
End Sub


However we find that this is quite unreliable. Often it runs when you test it and then fails to run after saving and re-opening.

Here's a possible solution which will only work in pptm files NOT ppsm files.

Add this code as well as any code above:

Sub onLoadCode()
Debug.Print "Running"
End Sub

Now use the information here to run this code when the presentation is opened. This code which does nothing visible kicks the vb editor into action (tech term) and the auto code should run when the show starts. No guarantees though.

Another way to make this fire is to add something that accesses the VB editor. You can add a button on slide one with simple code or even easier ANYTHING from the control toolbox (no code needed). Make it tiny and drag just off the top of the slide.

 

 

 

Back to the Index Page

POWERPOINT BLOG

Articles on your favourite sport

Free Microsoft PowerPoint Advice, help and tutorials, Template Links
This website is sponsored by Technology Trish Ltd
© Technology Trish 2007
Registered in England and Wales No.5780175
PowerPoint® is a registered trademark of the Microsoft Corporation