Close Method

       

Close method as it applies to the PageWindowEx object.

Closes the specified PageWindowEx object.

expression.Close(ForceSave)

expression   Required. An expression that returns one of the above objects.

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

Close method as it applies to the PageWindows object.

Closes the specified pages in the PageWindows collection, or, if Null, closes all open pages in the PageWindows collection.

expression.Close(Index, ForceSave)

expression   Required. An expression that returns one of the above objects.

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.

Close method as it applies to the WebWindows object.

Closes the specified WebWindowEx object.

expression.Close(Index)

expression   Required. An expression that returns one of the above objects.

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.

Close method as it applies to the WebEx and WebWindowEx objects.

Closes the specified object.

expression.Close

expression   Required. An expression that returns one of the above objects.

Example

As it applies to the PageWindowEx object.

The following example closes the active page window.

Sub CloseWindow()
'Closes the active page window

    Dim objApp As FrontPage.Application

    Set objApp = FrontPage.Application
    If Not objApp.ActivePageWindow Is Nothing Then
    objApp.ActivePageWindow.Close ForceSave:=True
 End If

End Sub

As it applies to the PageWindows collection.

The following example closes the first page window of the first web in the WebWindows collection.

Sub CloseWindow()
'Closes a page window

    Dim objApp As FrontPage.Application
    Dim objPgeWindows As PageWindows

    Set objApp = FrontPage.Application
    Set objPgeWindows = objApp.ActiveWeb.WebWindows(0).PageWindows
    objPgeWindows.Close Index:=0, ForceSave:=True

End Sub

As it applies to the WebWindows object.

The following example closes all open web windows.

Sub CloseWindow()
'Closes all web windows

    Dim objApp As FrontPage.Application
    Dim objPgeWindows As WebWindows

    Set objApp = FrontPage.Application
    Set objWebWindows = objApp.ActiveWeb.WebWindows
    objWebWindows.Close

End Sub

As it applies to the WebEx and WebWindowEx objects.

The following example closes the active web (if one exists).

Sub CloseWindow()
'Closes the active document

    Dim objApp As FrontPage.Application

    Set objApp = FrontPage.Application
    If Not objApp.ActiveWeb Is Nothing Then
    objApp.ActiveDocument.Close
 End If

End Sub