Vertices Property Example

This example assigns the vertex coordinates for shape one on myDocument to the array variable vertArray() and displays the coordinates for the first vertex. Shape one must be a freeform drawing.

Set myDocument = ActiveDocument
With myDocument.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 on myDocument. Shape one must be a Bézier curve containing 3n+1 vertices for this example to succeed.

Set myDocument = ActiveDocument
With myDocument.Shapes
    .AddCurve .Item(1).Vertices, Selection.Range
End With