OnClose Event

       

OnClose event as it applies to the PageWindowEx object.

Occurs when the active page window is closed by the user.

Private Sub expression_OnClose(Cancel As Boolean)

expression   A variable name which references an object of type PageWindowEX declared with events in a class module.

Cancel   A Boolean that determines if the operation will be cancelled. If True, the active page window will not be closed.

OnClose event as it applies to the WebEx object.

Occurs when the active web window is closed by the user.

Private Sub expression_OnClose(pCancel As Boolean)

expression   A variable name which references an object of type WebEx declared with events in a class module.

Cancel   A Boolean that determines if the operation will be cancelled. If True, the active web will not be closed.

Example

The following example prompts the user before closing the active page window. If the user clicks No, the window will not close.

Private Sub PgeWindowEx_OnClose(Cancel As Boolean)
'Displays a message

    Dim strAns As String
    'Prompt user
    strAns = MsgBox("Are you sure you want to close the active page window?", _
                    vbYesNo)
    If strAns = vbYes Then
        Cancel = False
    Else
        Cancel = True
    End If

End Sub