Share via


_XDocument4.IsDirty property

Gets a value that indicates whether the data in a Microsoft InfoPath form has been modified since it was last saved.

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

Syntax

'Declaration
ReadOnly Property IsDirty As Boolean
    Get
'Usage
Dim instance As _XDocument4
Dim value As Boolean

value = instance.IsDirty
bool IsDirty { get; }

Property value

Type: System.Boolean
Returns Boolean.

Implements

_XDocument3.IsDirty

Remarks

If the IsDirty property is true, data in the form's underlying XML document has been changed since it was last saved. If false, no changes have occurred.

Note

Changes that occur during an OnLoad event will not result in the IsDirty property being set to true.

Examples

In the following example, the IsDirty property of the XDocument object is used to determine whether data in the form has been changed:

if (thisXDocument.IsDirty)
{
 thisXDocument.UI.Alert("Data has been changed.");
}
else
{
 thisXDocument.UI.Alert("Data has not been changed.");
}

See also

Reference

_XDocument4 interface

_XDocument4 members

IsDirty overload

Microsoft.Office.Interop.InfoPath namespace