Shapes.AddPolyline Method
Adds an open or closed polygon to a document. Returns a Shape object that represents the polygon and adds it to the Shapes collection.
Namespace: Microsoft.Office.Interop.Word
Assembly: Microsoft.Office.Interop.Word (in Microsoft.Office.Interop.Word.dll)
Syntax
'Declaration
Function AddPolyline ( _
ByRef SafeArrayOfPoints As Object, _
ByRef Anchor As Object _
) As Shape
'Usage
Dim instance As Shapes
Dim SafeArrayOfPoints As Object
Dim Anchor As Object
Dim returnValue As Shape
returnValue = instance.AddPolyline(SafeArrayOfPoints, _
Anchor)
Shape AddPolyline(
ref Object SafeArrayOfPoints,
ref Object Anchor
)
Parameters
- SafeArrayOfPoints
Type: System.Object%
Required Object. An array of coordinate pairs that specifies the polyline drawing's vertices.
- Anchor
Type: System.Object%
Optional Object. A Range object that represents the text to which the polyline is bound. If Anchor is specified, the anchor is positioned at the beginning of the first paragraph in the anchoring range. If this argument is omitted, the anchoring range is selected automatically and the line is positioned relative to the top and left edges of the page.
Return Value
Type: Microsoft.Office.Interop.Word.Shape
Remarks
To form a closed polygon, assign the same coordinates to the first and last vertices in the polyline drawing.