Shapes.AddPolyline Method
Excel Developer Reference |
Creates an open polyline or a closed polygon drawing. Returns a Shape object that represents the new polyline or polygon.
Syntax
expression.AddPolyline(SafeArrayOfPoints)
expression A variable that represents a Shapes object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
SafeArrayOfPoints | Required | Variant | An array of coordinate pairs that specifies the polyline drawing's vertices. |
Return Value
Shape
Remarks
To form a closed polygon, assign the same coordinates to the first and last vertices in the polyline drawing.
Example
This example adds a triangle to myDocument
. Because the first and last points have the same coordinates, the polygon is closed and filled. The color of the triangle's interior will be the same as the default shape's fill color.
Visual Basic for Applications |
---|
|
See Also