OnAfterPageWindowViewChange Event

       

Occurs when a page window has switched view types.

Private Sub application__OnAfterPageWindowViewChange(ByVal pPage As PageWindow)

application   An object of type Application declared with events in a class module.

pPage   The PageWindowEx object in which the view has changed.

Example

The following example prompts the user to refresh the window after it has changed view modes.

Private Sub objApp_OnAfterPageWindowViewChange(ByVal pPage As PageWindow)
'Occurs when a view changes

    Dim strAns As String
    'Prompt user to refresh view
    strAns = MsgBox("The view has changed, would you like to refresh the window?", vbYesNo)
    If strAns = vbYes Then
        pPage.Refresh
    End If

End Sub