Table of contents
TOC
Collapse the table of content
Expand the table of content

Application.PresentationBeforeSave Event (PowerPoint)

office 365 dev account|Last Updated: 7/31/2017
|
2 Contributors

Occurs before a presentation is saved.

Syntax

expression. PresentationBeforeSave( Pres, Cancel )

expression A variable that represents an Application object.

Parameters

NameRequired/OptionalData TypeDescription
PresRequiredPresentationThe presentation being saved.
CancelRequiredBooleanTrue to cancel the save process.

Remarks

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, seeHow to: Use Events with the Application Object.

Example

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

See also

Concepts

Application Object

AutoSave

© 2018 Microsoft