LineFormat object provides access to line properties for shape borders, connectors, and chart elements. It controls line color, width, and dash style.
Usage
LineFormat object is typically accessed via the .line property of a shape such as Shape or Picture.
Properties
Read-only. ColorFormat instance providing access to line color settings.This is essentially a shortcut for
line.fill.fore_color.Important: As a side-effect, accessing this property causes the line fill type to be set to MSO_FILL.SOLID. If you need to non-destructively check the existing fill type, use line.fill.type first.Read-only. FillFormat instance for this line, providing access to fill properties.Lines can have solid fills, gradient fills, or pattern fills, just like shape fills.
Read/write. Width of the line as an integer number of English Metric Units (EMU).The returned value is an instance of
Length, which has properties like .inches, .cm, and .pt for unit conversion.Returns Emu(0) (effectively no line) when no explicit line width has been set.Assigning None sets the width to 0 (no line).Read/write. Line dash style from the
MSO_LINE_DASH_STYLE enumeration.Returns None if no explicit dash style has been set. When None, the line dash style is inherited from the style hierarchy.Assigning None removes any existing explicitly-defined dash style.Available dash styles include:MSO_LINE_DASH_STYLE.SOLID- Solid line (default)MSO_LINE_DASH_STYLE.DASH- Dashed lineMSO_LINE_DASH_STYLE.DASH_DOT- Alternating dashes and dotsMSO_LINE_DASH_STYLE.DASH_DOT_DOT- Dash followed by two dotsMSO_LINE_DASH_STYLE.DOT- Dotted lineMSO_LINE_DASH_STYLE.LONG_DASH- Long dashesMSO_LINE_DASH_STYLE.LONG_DASH_DOT- Long dash followed by dotMSO_LINE_DASH_STYLE.LONG_DASH_DOT_DOT- Long dash followed by two dotsMSO_LINE_DASH_STYLE.ROUND_DOT- Round dotsMSO_LINE_DASH_STYLE.SQUARE_DOT- Square dotsMSO_LINE_DASH_STYLE.SYSTEM_DASH- System dash styleMSO_LINE_DASH_STYLE.SYSTEM_DASH_DOT- System dash-dot styleMSO_LINE_DASH_STYLE.SYSTEM_DOT- System dot style