To use the SlideShowBegin event in Powerpoint, you need to configure the class module as follows:
Public WithEvents App As Application Private Sub App_SlideShowBegin(ByVal Wn As SlideShowWindow) MsgBox "SlideShowBegin" End Sub
Then, inside the non-class module, you must create an object of this type and install the application in the application.
Dim X As New Class1 Sub InitializeApp() Set X.App = Application End Sub
Now, the only problem I am facing is that if you did not manually call InitializeApp using the Macro menu in Powerpoint, the events do not work. You must call this unit before everything can call at the beginning of the slide show, INCLUDING this sub.
How can I call this subsection before starting my powerpoint? Is there a better way to do this?
EDIT:
I tried to use Class_Initialize, but it is called only after its first use or you do an operator like Dim X as Class1; X = new Class1
Dim X as Class1; X = new Class1
source share