# SaveEvent Object

An event object that is used during an OnSaveRequest event. The SaveEvent object provides a number of properties and methods that can be used during a save operation from the OnSaveRequest event handler to programmatically interact with a form's underlying XML document, determine save properties, and perform the save operation.

## Remarks

Note This object model member is not supported when the Disable Service Pack features option on the Advanced tab of the Options dialog box in InfoPath is selected or when Microsoft Office 2003 Service Pack 1 or later is not installed. Any form that implements this object model member in its code will generate an error message if it is opened in InfoPath when service pack features are disabled or unavailable.

## Using the SaveEvents object

The SaveEvent object is passed as a parameter to theOnSaveRequest event of an InfoPath form. The properties that it provides are available only during this event. This object expires when the save event expires so it may not be stored and used outside of the scope of the save event.

## Example

In the following example, the ReturnStatus property and the PerformSaveOperation method of the SaveEvent object are used to perform a standard InfoPath save operation:

    function XDocument::OnSaveRequest(eventObj)
    {
        eventObj.PerformSaveOperation();
        eventObj.ReturnStatus = true;
    }

©2003-2004 Microsoft Corporation. All rights reserved. Permission to copy, display and distribute this document is available at: http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp