Viewer.ShapeAtPoint property (Visio Viewer)

Gets the ID of the shape in the drawing that is open in Microsoft Visio Viewer, at the specified point in the Visio Viewer window, in the coordinate system of the window, measured in pixels. Read-only.

Syntax

expression.ShapeAtPoint (X, Y)

expression An expression that returns a Viewer object.

Parameters

Name Required/Optional Data type Description
X Required Long The x-coordinate, in pixels, of the point.
Y Required Long The y-coordinate, in pixels, of the point.

Return value

Long

Remarks

The origin of the coordinate system of the Visio Viewer window is the upper-left corner. The positive x-direction is to the right, and the positive y-direction is down.

If there is no shape at the specified point, the ShapeAtPoint property returns 0.

Example

The following code gets the ID of the shape at point (200, 200) in the drawing that is open in Visio Viewer.

Debug.Print vsoViewer.ShapeAtPoint (200, 200)

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.