SaveEventHandler Delegate
Represents the method that will handle the BeforeSave event of a Document.
Assembly: Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)
Parameters
- sender
-
Type:
System::Object^
The source of the event.
- e
-
Type:
Microsoft.Office.Tools.Word::SaveEventArgs^
A SaveEventArgs that contains the event data.
When you create a SaveEventHandler delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, until you remove the delegate.
The following code example demonstrates an event handler for the BeforeSave event. When you save the document, the event handler prompts you to cancel or continue with the save operation.
This example is for a document-level customization.
Show: