Results 1 to 7 of 7
  1. #1
    Star Lounger
    Join Date
    Jun 2004
    Location
    Gtr London, England
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Presentation Close (PowerPoint 2003)

    Morning

    I am struggling to identify the event that runs when a presentation is closed. In Word we have the option under "This Document" to "Open", "Close", "New" so it is fairly simply to identify where to place the code, but this is not the case for PowerPoint.

    Can anyone help? I have set up a class and used "AutoExec" as a Sub but this does not run when the presentation is closed, also tried "AutoClose" (just in case) but still no joy.

    Regards
    Jack

  2. #2
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Presentation Close (PowerPoint 2003)

    Does this article answer it?

    Alan

  3. #3
    Star Lounger
    Join Date
    Jun 2004
    Location
    Gtr London, England
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Presentation Close (PowerPoint 2003)

    The msdn example wasn't too helpful but searching for PresentationClose has solved my problem. Thanks, I had looked at this but hadn't really taken on board what I was looking for.

    Regards
    Jack

  4. #4
    Star Lounger
    Join Date
    Jun 2004
    Location
    Gtr London, England
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Presentation Close (PowerPoint 2003)

    Well I thought I had solved it but now realise I still haven't solved this one !!! Setting up the function which calls the class (PresentationClose) is fine but the only way I can get this function to run is if I open the Presentation, go to VBA, run the function (which includes Set Object.ClassFunction). When I close the presentation it runs the code in PresentationClose, it will only run this way. Do you know what I need to call to initialise the Class?

    Hope I'm making sense !
    Thanks
    Jack

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Presentation Close (PowerPoint 2003)

    A PowerPoint presentation does not have a ThisPresentation object with events, comparable to the ThisDocument object in a Word document and the ThisWorkbook object in an Excel workbook. To initialize the class, you must create an add-in (.ppa) with an Auto_Open macro.

    See Make PPT respond to events; this article by Shyam Pillai contains a link to download his AutoEvents add-in.

  6. #6
    Star Lounger
    Join Date
    Jun 2004
    Location
    Gtr London, England
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Presentation Close (PowerPoint 2003)

    The link you sent is the one I have been using to set up the Event Handler, but thanks anyway.

    The problem I have is that Shyma is running the Event Handler via an object on the slide. When you click the button on the presentation, the Event Handler code runs, so that when you close the presentation, PresentationClose then runs. If you open the presentation and close it the PresentationClose function does not run because the Event Handler has not been activated.

    My query is, how can I activate the Event Handler when the presentation is open, so that it then runs the PresentationClose function on close. I would prefer to run the code in the background rather than the user having to click on a button to active the Event Handler.

    Regards
    Jack

  7. #7
    Star Lounger
    Join Date
    Jun 2004
    Location
    Gtr London, England
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Presentation Close (PowerPoint 2003)

    Hi Hans

    I've sussed it ..... I have a Toolbar that opens a Presentation, so I've placed the Event Handler after the line of code that creates a new presentation. Seems to be running a treat.

    Thanks for your time as always.
    Jack

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •