This example adds a triangle to myDocument
. Because the first and last points of the triangle have the same coordinates, the polygon is closed and filled.
Dim triArray(1 To 4, 1 To 2) As Single
triArray(1, 1) = 25
triArray(1, 2) = 100
triArray(2, 1) = 100
triArray(2, 2) = 150
triArray(3, 1) = 150
triArray(3, 2) = 50
triArray(4, 1) = 25 ' Last point has same coordinates as first
triArray(4, 2) = 100
Set myDocument = Documents.Add
myDocument.Shapes.AddPolyline triArray