FormEvents::Save event
Namespace: Microsoft.Office.InfoPath
Assembly: Microsoft.Office.InfoPath (in Microsoft.Office.InfoPath.dll)
| Exception | Condition |
|---|---|
| InvalidOperationException | The developer attempted to bind the event in some location other than the InternalStartup method. |
Important |
|---|
The Save event is not meant to be instantiated by the developer in form code. You should only add event handlers for form-level events from the Microsoft InfoPath design mode user interface. When you add an event handler to your form template from the design mode user interface, InfoPath generates code in the InternalStartup method of your form code file using the EventManager class and the member of the FormEvents class to bind the event to its event handler. For information on how to add event handlers in InfoPath design mode, see How to: Add an Event Handler. |
The Save event is raised only if the form template has the Save using custom code option set in the Form Options dialog box.
The Save event is bound using the SaveEventHandler delegate.
The Save event can be cancelled by using the CancelableArgs property of the SaveEventArgs class to set the Cancel property to true.
The SaveEventArgs object, which is passed as a parameter to an event handler for the Save event, provides properties and methods that can be used to get the form's file name, determine save status, and perform the save operation.
This type or member can be accessed only from code running in forms opened in Microsoft InfoPath Filler.
Important