Close Method

Microsoft FrontPage Visual Basic

Closes the specified PageWindowEx object.

expression.Close(ForceSave, PromptUser)

expression    Required. An expression that returns the above object.

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

PromptUser   Optional Boolean. True prompts the user before closing the page. Default is False.

ShowClose 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, PromptUser)

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.

PromptUser   Optional Boolean. True prompts the user before closing the pages. Default is False.

ShowClose 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.

ShowClose 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

ShowAs 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

ShowAs it applies to the PageWindows collection.

The following example closes the first page window of the first Web site 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

ShowAs it applies to the WebWindows object.

The following example closes all open Web windows.

Sub CloseWindow()
'Closes all Web page windows.

    Dim objApp As FrontPage.Application
    Dim objPgeWindows As WebWindows

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

End Sub

ShowAs it applies to the WebEx and WebWindowEx objects.

The following example closes the active Web site (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