# ReturnStatus Property (DocReturnEvent Object)

Sets or retrieves a Boolean value indicating the return status of the OnLoad and OnSubmitRequest events.

expression.ReturnStatus

expression Required. Returns a reference to the DocReturnEvent object.

## Security Level

2: Can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.

## Remarks

If the ReturnStatus property is set to False, the OnLoad and OnSubmitRequest events fail. If set to True, the OnLoad and OnSubmitRequest events are successful. The default value for the OnLoad event is True, and the default value for the OnSubmitRequest event is False.

## Example

In the following example, the ReturnStatus property of the DocReturnEvent object is used to indicate that the OnLoad event was not successful:

    function XDocument::OnLoad(eventObj)
    {
       // Cancel the event.
       eventObj.ReturnStatus = false;
    }

©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