Viewer.ShapeName property (Visio Viewer)
Gets the name of the shape at the specified index in the collection of shapes in the drawing that is open in Microsoft Visio Viewer. Read-only.
Syntax
expression.ShapeName (ShapeIndex)
expression An expression that returns a Viewer object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
ShapeIndex | Required | Long | The index of the shape in the collection of shapes. |
Return value
String
Remarks
The collection of shapes is one-based, so the index of the first shape in the collection is 1. If there are no shapes in the drawing, or if you pass the index of a nonexistent shape, the ShapeName property returns nothing.
The ShapeName property returns the local name of the shape, not its universal name.
Example
The following code gets the names 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.ShapeName(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.