Application.OnBeforePageSave Event
SharePoint Designer Developer Reference |
Occurs before a page is saved.
Syntax
Private Sub expression_OnBeforePageSave(ByVal pPage As PageWindow, SaveAsUI As Boolean, Cancel As Boolean)
expression A variable that references an Application object that has been declared by using the WithEvents keyword in a class module.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
pPage | Required | PageWindow | The window that contains the page to save. |
SaveAsUI | Required | Boolean | True when the Save As dialog box is used to save a page. This can be the first time the page is saved or when the page is saved as a new page. False when when an existing page is saved. |
Cancel | Required | Boolean | Aborts the save when set to True. When Cancel is programmatically set to True, the user can abort the save process by clicking the Cancel button on the form. Default is False. |
Remarks
The OnBeforePageSave event is associated with the Application object. When the user saves a page or closes Office SharePoint Designer, the OnBeforePageSave event fires and executes the code that you specified within the event procedure.
If you set Cancel to True, the page is not saved.
See Also