Share via


Shape.Vertices Property

Word Developer Reference

Returns the coordinates of the specified freeform drawing's vertices (and control points for Bézier curves) as a series of coordinate pairs. Read-only Variant.

Syntax

expression.Vertices

expression   Required. A variable that represents a Shape object.

Remarks

You can use the array returned by this property as an argument for the AddCurve or AddPolyLine method.

The following table shows how the Vertices property associates values in the array vertArray() with the coordinates of a triangle's vertices.

vertArray element Contains
Visual Basic for Applications
  vertArray(1, 1)
The horizontal distance from the first vertex to the left side of the document.
Visual Basic for Applications
  vertArray(1, 1)
Visual Basic for Applications
  vertArray(1, 2)
The vertical distance from the first vertex to the top of the document.
Visual Basic for Applications
  vertArray(1, 2)
Visual Basic for Applications
  vertArray(2, 1)
The horizontal distance from the second vertex to the left side of the document.
Visual Basic for Applications
  vertArray(2, 1)
Visual Basic for Applications
  vertArray(2, 2)
The vertical distance from the second vertex to the top of the document.
Visual Basic for Applications
  vertArray(2, 2)
Visual Basic for Applications
  vertArray(3, 1)
The horizontal distance from the third vertex to the left side of the document.
Visual Basic for Applications
  vertArray(3, 1)
Visual Basic for Applications
  vertArray(3, 2)
The vertical distance from the third vertex to the top of the document.
Visual Basic for Applications
  vertArray(3, 2)

Example

This example assigns the vertex coordinates for shape one in the active document to an array variable and displays the coordinates for the first vertex. Shape one must be a freeform drawing.

Visual Basic for Applications
  With ActiveDocument.Shapes(1)
    vertArray = .Vertices
    x1 = vertArray(1, 1)
    y1 = vertArray(1, 2)
    MsgBox "First vertex coordinates: " & x1 & ", " & y1
End With

This example creates a curve that has the same geometric description as shape one in the active document. This example assumes that the first shape is a Bézier curve containing 3n+1 vertices, where n is the number of curve segments.

Visual Basic for Applications
  With ActiveDocument.Shapes
    .AddCurve .Item(1).Vertices, Selection.Range
End With

See Also