Close Method

See Also         Example         Applies To

Closes the specified object.

Syntax 1: Closes the specified PageWindow object.

Syntax 2: Closes the specified pages in the PageWindows collection, or, if null, closes all open pages in the PageWindows collection.

Syntax 3: Closes the specified WebWindow object.

Syntax 4: Closes the specified webs in the WebWindows collection.

Syntax 1

expression.Close([ForceSave As Boolean])

expression   An expression that returns a PageWindow object.

ForceSave   Optional Boolean. True forces the specified file to be saved before the Close method is completed. Default is False.

Return Type

Void

Syntax 2

expression.Close([Index],[ForceSave As Boolean])

expression   An expression that returns an object from the PageWindows collection.

Index   Optional Variant. Refers to an individual item in the PageWindows collection. Can be any number corresponding to an item in the collection, with the index starting at zero.

ForceSave   Optional Boolean. True forces the specified file to be saved before the Close method is completed. Default is False.

Return Type

Void

Syntax 3

expression.Close()

expression   An expression that returns a WebWindow object.

Return Type

Void

Syntax 4

expression.Close(Index)

expression   An expression that returns an object in the WebWindows collection.

Index   Optional Variant. Refers to an item in the WebWindows collection. Can be any number corresponding to an item in the collection, with the index starting at zero.

Return Type

Void

Remarks

The following examples illustrate how you use each type of syntax with the Close method.

Syntax 1: The PageWindow object provides an optional forced save argument, set in the following statement to True, so that before myPageWindow is closed, it will be saved.

myPageWindow.Close(True)

However, to close myPageWindow without forcing a save, remove the forced save argument from between the parentheses, as shown in the following statement, or set the argument to False.

myPageWindow.Close()
myPageWindow.Close(False)

Syntax 2: The PageWindows collection also provides the optional forced save argument along with an index to reference individual PageWindow objects. The following statement shows an individual page in the collection closed with a forced save.

myPageWindows.Close(2,True)

Note   If the argument is null, as in the following statement, Microsoft FrontPage closes all open pages.

myPageWindows.Close()

Syntax 3: The WebWindow object uses a straightforward Close method. This method is useful when you want to analyze webs and don't need to work with individual pages in the web.

myWebWindow.Close

Syntax 4: The WebWindows collection provides a zero-based index to reference individual WebWindow objects. The following statement closes the second open WebWindow object.

myWebWindow.Close(1)

Note   If the argument is null as in the following statement, Microsoft FrontPage closes all open web windows.

myPageWindows.Close()