Home Addins Tips VBA FAQ Utilities Licensing Disclaimer Privacy Policy

Event Generator 1.2

Microsoft PowerPoint 2000 and later versions support a lot of events. The handler for these events can only reside in addins. The free Event Generator addin redirects these events to the presentations.

Event Generator addin calls the following subroutines in all modules in the presentation when it receives the events from PowerPoint:

  • OnPresentationClose() - Called before the presentation is closed.
  • OnPresentationNewSlide() - Called when a new slide is created in the presentation.
  • OnPresentationOpen() - Called after the presentation is opened.
  • OnPresentationPrint() - Called when the presentation is printed.
  • OnPresentationSave() - Called when the presentation is saved.
  • OnSlideShowBegin() - Called when the slide show begins.
  • OnSlideShowEnd() - Called when the slide show ends.
  • OnSlideShowNextBuild() - Called upon mouse-click or timing animation, but before the animated object becomes visible.
  • OnSlideShowNextSlide() - Called immediately before the transition to the next slide. For the first slide, it occurs immediately after the OnSlideShowBegin() event.
  • OnWindowActivate() - Called when the presentation window activates.
  • OnWindowBeforeRightClick() - Called when the user clicks the right mouse button. It is called before the right-click context menu is shown. This handler can disable showing of the context handler.
  • OnWindowDeactivate() - Called when the presentation window deactivates.
  • OnWindowSelectionChange() - Called when the currently selected shape or slide changes.

They should be declared exactly as the following:

Sub OnPresentationClose(ByVal Pres As Presentation)
    MsgBox "OnPresentationClose: Presentation " + Pres.Name + " closed!"
End Sub

Sub OnPresentationNewSlide(ByVal Sld As Slide)
    MsgBox "OnPresentationNewSlide: New slide " + _
        Trim(Str(Sld.SlideID)) + "/" + Trim(Str(Sld.SlideIndex)) + " inserted"
End Sub

Sub OnPresentationOpen(ByVal Pres As Presentation)
    MsgBox "OnPresentationOpen: Presentation " + Pres.Name + " opened!"
End Sub

Sub OnPresentationPrint(ByVal Pres As Presentation)
    MsgBox "OnPresentationPrint: Presentation " + Pres.Name + " printed!"
End Sub

Sub OnPresentationSave(ByVal Pres As Presentation)
    MsgBox "OnPresentationSave: Presentation " + Pres.Name + " saved!"
End Sub

Sub OnSlideShowBegin(ByVal Wn As SlideShowWindow)
    MsgBox "OnSlideShowBegin: Beginning slide show: " + Wn.Presentation.Name
End Sub

Sub OnSlideShowEnd(ByVal Pres As Presentation)
    MsgBox "OnSlideShowEnd: Slide show ended: " + Pres.Name
End Sub

Sub OnSlideShowNextBuild(ByVal Wn As SlideShowWindow)
    MsgBox "OnSlideShowNextBuild: Showing next build: " + _
        Wn.Presentation.Name + ":" + Str(Wn.View.Slide.SlideID)
End Sub

Sub OnSlideShowNextSlide(ByVal Wn As SlideShowWindow)
    MsgBox "OnSlideShowNextSlide: Showing next slide: " + _
        Wn.Presentation.Name + ":" + Str(Wn.View.Slide.SlideID)
End Sub

Sub OnWindowActivate(ByVal Pres As Presentation, ByVal Wn As DocumentWindow)
    MsgBox "OnWindowActivate: " + Pres.Name
End Sub

Sub OnWindowBeforeRightClick(ByVal Sel As Selection, Cancel As Boolean)
    MsgBox "OnWindowBeforeRightClick: " + Sel.Parent
End Sub

Sub OnWindowDeactivate(ByVal Pres As Presentation, ByVal Wn As DocumentWindow)
    MsgBox "OnWindowDeactivate: " + Pres.Name
End Sub

Sub OnWindowSelectionChange(ByVal Sel As Selection)
    MsgBox "OnWindowSelectionChange: " + Sel.Parent
End Sub

Download

Event Generator is supported on Microsoft PowerPoint 2000, PowerPoint XP and PowerPoint 2003. Download the 315 KB installation executable from here. A sample PowerPoint presentation that contains event handlers for events fired by Event Generator is included in the installation.

Installation Instructions

  • Download and save EventGen12.exe.

  • Execute EventGen12.exe and follow the instructions given at the end of the installation.

EventGenerator source code

The source code for EventGenerator addin consists of VBA code. It can be a good resource for enhancing your VBA skills. EventGenerator addin source code can be purchased online using credit card. Click here to purchase.


Copyright © 2001-2008 OfficeOne. All rights reserved.