次の方法で共有


_XDocument2.SetDirty Method

Sets the IsDirty property for the XDocument object, which indicates whether the data in a form has been modified since it was last saved.

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

Syntax

'Declaration
Sub SetDirty ( _
    vfIsDirty As Boolean _
)
'Usage
Dim instance As _XDocument2
Dim vfIsDirty As Boolean

instance.SetDirty(vfIsDirty)
void SetDirty(
    bool vfIsDirty
)

Parameters

  • vfIsDirty
    Type: System.Boolean

    Specifies whether the form is to be marked as unmodified or not.

Remarks

The SetDirty method can be used from the OnSubmitRequest event to force a document to be marked as unchanged. InfoPath will therefore not request the user to save the form when it is closed.

The SetDirty method can also be used from the OnSaveRequest event to programmatically mark the form as changed or unchanged since it was last saved.

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 IsDirty property of the current form is set to false so that the user will not be prompted to save the form when it is closed.

thisXDocument.SetDirty(false);

See Also

Reference

_XDocument2 Interface

_XDocument2 Members

Microsoft.Office.Interop.InfoPath.SemiTrust Namespace