SetDocumentDirty

Syntax

SetDocumentDirty [Dirty]

Remarks

Controls whether Word recognizes a document as "dirty" — that is, changed since the last time the document was saved. When a dirty document is closed, Word displays a prompt asking if changes should be saved.

If you change a document and then set Dirty to 0 (zero), Word recognizes the document as unchanged, or "clean." When you close the document, Word neither displays a prompt nor saves changes.

Argument

Explanation

Dirty

Specifies whether to make the active document dirty:

0 (zero) The document is treated as clean.

1 or omitted The document is recognized as dirty.


Example

This example assumes that a main document for a mail merge is active. The instructions print form letters to a document, which is then made clean. When the document is closed, Word will not display a prompt or save changes.


MailMergeToDoc
SetDocumentDirty 0

See Also

IsDocumentDirty(), IsTemplateDirty(), SetTemplateDirty