IsDocumentDirty()

Syntax

IsDocumentDirty()

Remarks

Returns a value indicating whether the active document has changed since it was last saved (that is, if it is "dirty"). Whether a document is dirty determines if Word displays a prompt to save changes when the document is closed.

Value

Explanation

0 (zero)

If the document has not changed since it was last saved

–1

If the document has changed since it was last saved


Example

This example saves the active document if there are unsaved changes:


If IsDocumentDirty() = -1 Then FileSave

See Also

IsTemplateDirty(), SetDocumentDirty, SetTemplateDirty