Viewer.ShapeName Property

Visio Viewer

Gets the name of the shape at the specified index in the collection of shapes in the drawing open in the Microsoft Office Visio 2007 Viewer. Read-only.

Version Information
 Version Added:  Visio 2007

Syntax

expression.ShapeName(ShapeIndex)

expression   An expression that returns a Viewer object.

Parameters

Name Required/Optional Data Type Description
ShapeIndex Required Long

Return Value
String

Remarks

The collection of shapes is 1-base, 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 non-existent shape, the ShapeName property returns nothing.

The ShapeName property returns the local name of the shape, not the universal name of the shape.

Example
The following code gets the names of all the shapes in the drawing open in the Viewer.

Visual Basic for Applications
  Dim intCounter As Integer
    For intCounter = 1 To Viewer1.ShapeCount
    Debug.Print Viewer1.ShapeName(intCounter)
Next intCounter