DocReturnEvent Object

InfoPath Developer Reference

An event object that is used during a Microsoft Office InfoPath 2007 load or submission event.

Version Information
 Version Added:  InfoPath 2003

Remarks

The DocReturnEvent object provides the XDocument property that can be used within a load or submission event to programmatically interact with the data in a form's underlying XML document. It also provides the ReturnStatus property that is used to specify whether the event is successful.

The DocReturnEvent object is passed as a parameter to the OnLoad and OnSubmitRequest events of an InfoPath form. The properties that it provides are available only during these events.

For more information about using the DocReturnEvent object, see Responding to form events.

Example

In the following example, the XDocument property of the DocReturnEvent object is used to display the source XML of a form's underlying XML document using the DOM property of the XDocument object:

JScript
  function XDocument::OnLoad(eventObj)
{
   XDocument.UI.Alert("The source XML: " + eventObj.XDocument.DOM.xml);
   eventObj.ReturnStatus = true;
}

See Also