DocClose

Syntax

DocClose [Save]

Remarks

Closes the active document window. DocClose is not the same as FileClose: Whereas FileClose closes the active document and all associated windows, DocClose closes only the active document window. When a document is open in a single window, which is usually the case, DocClose and FileClose have the same effect.

Argument

Explanation

Save

Determines whether or not to save the document:

0 (zero) or omitted Prompts the user to save if changes have been made in the document since the last time it was saved.

1 Saves the document without prompting before closing it.

2 Closes the window but does not save the document.

The Save argument also controls whether a prompt appears if the document has a routing slip. A prompt appears if Save is 0 (zero) or omitted; otherwise, the document is closed without being routed.


Example

This example closes every open document window and prompts the user to save any unsaved changes:


While Window() <> 0
    DocClose 0
Wend

See Also

ClosePane, FileClose