April 2006
Beginner
1114 pages
98h 16m
English
shapes.AddPolyline(SafeArrayOfPoints)
Draws a segmented line from an array of coordinate pairs and returns the line’s Shape object.
|
Argument |
Settings |
|---|---|
|
|
The 2-D array of points containing the vertices of the line |
Use the Line property to set the style and formatting used for the line. The following code draws a Z-shaped line that starts at (80,100) and ends at (110,30):
Sub DrawZ( )
Dim s As Shape, pts( ) As Single
' Array of points.
ReDim pts(3, 1)
pts(0, 0) = 80
pts(0, 1) = 100
pts(1, 0) = 200
pts(1, 1) = 150
pts(2, 0) = 15
pts(2, 1) = 20
pts(3, 0) = 110
pts(3, 1) = 30
' Draw a curve
Set s = ActiveSheet.Shapes.AddPolyline(pts)
End SubRead now
Unlock full access