Viewer.ShapeIDToIndex property (Visio Viewer)

Gets the index in the collection of shapes of the shape with the specified ID in the drawing that is open in Microsoft Visio Viewer. Read-only.

Syntax

expression.ShapeIDToIndex (ShapeID)

expression An expression that returns a Viewer object.

Parameters

Name Required/Optional Data type Description
ShapeID Required Long The ID of the shape.

Return value

Long

Remarks

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

Example

The following code gets the index position of all the shapes in the drawing that is open in Visio Viewer.

Dim intCounter As Integer

    For intCounter = 1 To Viewer1.ShapeCount

    Debug.Print Viewer1.ShapeIDToIndex(intCounter)

Next intCounter

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.