Viewer.OnPageChanged event (Visio Viewer)

Occurs when the active page is changed in Microsoft Visio Viewer.

Syntax

expression.OnPageChanged (PageIndex)

expression An expression that returns a Viewer object.

Parameters

Name Required/Optional Data type Description
PageIndex Required Long The index of the new page.

Return value

Nothing

Remarks

The collection of pages in the Viewer is one-based, so the index of the first page in the collection is 1.

You can change the page programmatically in Visio Viewer by setting the value of the CurrentPageIndex property.

Example

The following code shows how to use the OnPageChanged event to print a message in the Immediate window stating that the page has changed and identifying the new page.

Private Sub vsoViewer_OnPageChanged(ByVal PageIndex As Long)

    Debug.Print "Page changed to"; vsoViewer.CurrentPageIndex

End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.