Close Method

Home Page (Objects)OverviewFAQReference

Applies to: Document object, TextDocument object, TextWindow object, Window object

Closes windows.

Syntax

object.Close ( [SaveChanges] )

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

SaveChanges

(Optional) An enum of type DsSaveChanges that indicates whether to save changes to a document before closing it. Following are the possible values, which have the Long type:

Return Values

The Close method returns the enum dsSaveStatus, which has one of the following values:

Remarks

The following table summarizes the results of using Close with objects in the Applies To list:

Object Results
Document
TextDocument
Closes all windows associated with the document and removes them from the Windows collection obtained by using the Windows property of the Application object.

Closes the document and removes it from the Documents collection.

TextWindow
Window
Closes the window and removes it from the Windows collection obtained by using the Windows property of the Application object. Additionally, if that window was the only one open on a document, then that document is closed and removed from the Documents collection

Example

The following example saves all changes to the current document and then closes all windows in the document:

ActiveDocument.Close