LineFormat Members
Use the LineFormat object to change the appearance of line shapes. Use the Shape object’s Line property to get a reference to this collection. The LineFormat object has the following members:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Use the LineFormat object to add an arrowhead to a line, set the line weight, and set the style as shown by the following code:
Sub LineFormatMembers( )
Dim ws As Worksheet, s As Shape
Set ws = ActiveSheet
' Draw a line.
Set s = ws.Shapes.AddLine(60, 60, 200, 200)
' Add an arrowhead.
s.Line.BeginArrowheadStyle = msoArrowheadOpen
s.Line.BeginArrowheadLength = msoArrowheadLengthMedium
s.Line.BeginArrowheadWidth = msoArrowheadWidthMedium
s.Line.EndArrowheadStyle = msoArrowheadOval
' Change line weight (in points)
s.Line.Weight = 4
' Change line style.
s.Line.DashStyle = msoLineDash
End SubBecome an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access