multiple event handlers

T

theintern

Does anyone know how to create multiple event handlers? I want to have the
same event fire on two different events, PresentationOpen (as seen below) and
SlideShowEnd. See code below.

Module 1:
Public cPPTObject As New EventClass

Sub Auto_Open()
'set an application reference to the event-enabled object
Set cPPTObject.PPTEvent = Application
End Sub

Module 2:
Sub CreateShow()
all the stuff i want it to do
End sub

Class module:
Public WithEvents PPTEvent As Application

Private Sub PPTEvent_PresentationOpen(ByVal Pres As Presentation)
CreateShow
End Sub

i tried some stuff, but all of it is just guess, so i figured it'd be faster
to just ask.

thanks
scott
 
T

theintern

Seems like a neat tool, but i'm a little unsure how it may help me. can you
explain a bit more? thanks
 
T

theintern

I've seen this demo, but am not really sure what that is supposed to be doing
for me either. it just opens a powerpoint, i click around, it says it's
running, nothing happens, and then i quit the program. what exactly am i
supposed to be getting from that? sorry, i must be missing something.

scott
 
A

Austin Myers

Events in PPT are different than the other office apps.

In other office apps the event trap is built in to the object model, in PPT
you must built your own trap as a Class Module. (It MUST be a Class
Module.) That is what Shyam has provided for you.

From that point the Event Trap must "Call" your code. Assume that you want
to put up a message box each time a slide starts. You would use the
NextSlide event in a Class Module and when its triggered by PowerPoint it
"Calls" your code to display the message box.


Austin Myers
Microsoft PowerPoint MVP Team

Creator of PFCPro, PFCMedia and PFCExpress
http://www.playsforcertain.com
 

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