Application.PresentationBeforeSave Event (PowerPoint)
Occurs before a presentation is saved.
This event is triggered as the Save As dialog box appears.
To access the Application events, declare an Application variable in the General Declarations section of your code. Then set the variable equal to the Application object for which you want to access events. For information about using events with the Microsoft PowerPoint Application object, see How to: Use Events with the Application Object.
This example checks if there are revisions in a presentation and, if there are, asks whether to save the presentation. If a user's response is no, the save process is canceled. This example assumes an Application object called PPTApp has been declared by using the WithEvents keyword.
Private Sub PPTApp_PresentationBeforeSave(ByVal Pres As Presentation, _ Cancel As Boolean) Dim intResponse As Integer Set Pres = ActivePresentation If Pres.HasRevisionInfo Then intResponse = MsgBox(Prompt:="The presentation contains revisions. " & _ "Do you want to accept the revisions before saving?", Buttons:=vbYesNo) If intResponse = vbYes Then Cancel = True MsgBox "Your presentation was not saved." End If End If End Sub