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

Viewer.OnSelectionChanged Event (Visio Viewer)

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

Occurs when the shape selection is changed in Microsoft Visio Viewer.

Syntax

expression. OnSelectionChanged( ShapeIndex)

_expression_An expression that returns a Viewer object.

Parameters

NameRequired/OptionalData TypeDescription
ShapeIndexRequiredLongThe index of the newly selected shape.

Return Value

Nothing

Remarks

The collection of shapes in the Viewer is one-based, so the first shape in the collection has index 1.

You can change the selected shape in Visio Viewer programmatically by using the SelectShape method.

Example

The following code shows how to use the OnSelectionChanged event to print the ID of the newly selected shape in Visio Viewer in the Immediate window.

Private Sub vsoViewer_OnSelectionChanged(ByVal ShapeIndex As Long)



    Debug.Print "Selected shape changed to shape " &; vsoViewer.SelectedShapeIndex &; "."



End Sub
© 2018 Microsoft