PresentationClose Event

Microsoft PowerPoint Visual Basic

Show All

PresentationClose Event

       

Occurs immediately before any open presentation closes, as it is removed from the Presentations collection.

Private Sub application_PresentationClose(ByVal Pres As Presentation)

application   An object of type Application declared with events in a class module. For information about using events with the Application object, see Using Events with the Application Object.

Pres   The presentation that is being closed.

Example

This example saves a copy of the active presentation as an HTML file, with the same name and within the same folder.

Private Sub App_PresentationClose(ByVal Pres As Presentation)
    FindNum = InStr(1, Pres.FullName, ".")
    HTMLName = Mid(Pres.FullName, 1, FindNum - 1) _
        & ".htm"
    Pres.SaveCopyAs HTMLName, ppSaveAsHTML
End Sub