SaveEvent.IsCancelled Property

Gets or sets a value that provides additional information for use in OnSaveRequest event in conjunction with the ReturnStatus property.

Namespace:  Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly:  Microsoft.Office.Interop.InfoPath.SemiTrust (in Microsoft.Office.Interop.InfoPath.SemiTrust.dll)

Syntax

'Declaration
Property IsCancelled As Boolean
    Get
    Set
'Usage
Dim instance As SaveEvent
Dim value As Boolean

value = instance.IsCancelled

instance.IsCancelled = value
bool IsCancelled { get; set; }

Property Value

Type: System.Boolean

Remarks

When closing InfoPath, the user is prompted to save the document if the IsDirty property is true. If the IsCancelled property is true, InfoPath will be prevented from closing if the save operation fails (that is, the ReturnStatus property is false).

Important

This member 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.

Examples

In the following example, the IsCancelled property of the SaveEventObject object is used to ensure that the document does not close if the save operation was cancelled:

e.IsCancelled = e.PerformSaveOperation();
if(e.IsCancelled)
    return;
e.ReturnStatus = true;

See Also

Reference

SaveEvent Interface

SaveEvent Members

Microsoft.Office.Interop.InfoPath.SemiTrust Namespace