Start Slide Show Event

P

Paul D.

I am using PP in Office 2007.
I have several macros that each run when various action buttons are clicked.
I have several public variables that are used between the macros. I want to
make sure each public variable is assigned its proper value when I start the
slide show. I can't find any start slide show events.

In my VBAProject(project name) I only have Module1.

For example I tried:

Private Sub App_SlideShowBegin(ByVal Wn As SlideShowWindow)
booVar1 = False
booVar2= True
boovar3 = False

End Sub

This sub doesn't run when I start the slide show.

Can anyone help me with this? If you can show me how to make sure the
boolean varibles are set to true of false when the slide show begins, I can
figure out the other variables.

Thanks
 
C

Chirag

Check that App is declared WithEvents in a Class Module. For your reference,
the following code works:

In Class Module: Class1:
---
Option Explicit

Private WithEvents App As PowerPoint.Application

Private Sub App_SlideShowBegin(ByVal Wn As SlideShowWindow)
MsgBox "Starting slide show"
End Sub

Private Sub Class_Initialize()
Set App = PowerPoint.Application
End Sub

Private Sub Class_Terminate()
Set App = Nothing
End Sub
---

In a Module: Module1:
---
Option Explicit

Private Obj1 As Class1

Sub Auto_Open()
Set Obj1 = New Class1
End Sub

Sub Auto_Close()
Set Obj1 = Nothing
End Sub
---

Execute Auto_Open in VBA Editor and start the slide show. You should see a
message box with "Starting slide show" message in it.

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html
 
P

Paul D.

Worked as advertised. This was exactly what I was looking for.

I added to your Sub Auto_Open() the following:

ActivePresentation.SlideShowSettings.Run
ActivePresentation.SlideShowWindow.View.GotoSlide (1)

so the slide show begins automatically when I execute Auto_Open.

Thanks for the help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top