Table of contents
Collapse the table of content
Expand the table of content

Viewer.OnPageChanged Event (Visio Viewer)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

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


expression. OnPageChanged( PageIndex)

_expression_An expression that returns a Viewer object.


NameRequired/OptionalData TypeDescription
PageIndexRequiredLongThe index of the new page.

Return Value



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.


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
© 2018 Microsoft