Class LineFormat (PowerPoint VBA)

The class LineFormat represents line and arrowhead formatting. For a line, the LineFormat object contains formatting information for the line itself; for a shape with a border, this object contains formatting information for the shape's border.

Set

To use a LineFormat class variable it first needs to be instantiated, for example

Dim lft as LineFormat
Set lft = ActiveWindow.RangeFromPoint.Line

The following procedures can be used to set variables of type LineFormat: Cell.Borders, CellRange.Borders, Borders.Item, ChartFormat.Line, Shape.Line and ShapeRange.Line

Themes

The following procedures in this class have been grouped together and are described on a separate theme page

Format with its procedures BackColor, BeginArrowheadStyle, BeginArrowheadWidth, DashStyle, EndArrowheadStyle, EndArrowheadWidth, ForeColor, Style and Visible

Properties

Borders.Count returns the number of objects in the specified collection.

Dim lngCount As Long
lngCount = ActiveWindow.RangeFromPoint.Table.Rows(1).Cells.Borders.Count

Borders.Parent returns the parent object for the specified object.

Dim objParent As Object
Set objParent = ActiveWindow.RangeFromPoint.Table.Rows(1).Cells.Borders.Parent

BeginArrowheadLength returns or sets the length of the arrowhead at the beginning of the specified line.

ActivePresentation.Slides(1).Shapes(1).Line.BeginArrowheadLength = msoArrowheadLengthMixed

EndArrowheadLength returns or sets the length of the arrowhead at the end of the specified line.

ActivePresentation.Slides(1).Shapes(1).Line.EndArrowheadLength = msoArrowheadLengthMixed

InsetPen determines whether to draw lines on the inside of a specified shape.

ActiveWindow.RangeFromPoint.Line.InsetPen = msoTrue

Parent returns the parent object for the specified object.

Dim objParent As Object
Set objParent = ActiveWindow.RangeFromPoint.Line.Parent

Pattern sets or returns a value that represents the pattern applied to the specified line.

ActivePresentation.Slides(1).Shapes(1).Line.Pattern = msoPatternMixed

Transparency returns or sets the degree of transparency of the specified fill, shadow, or line as a value between 0.0 (opaque) and 1.0 (clear).

ActivePresentation.Slides(1).Shapes(1).Line.Transparency = 0.5

Weight returns or sets the thickness of the specified line, in points.

ActivePresentation.Slides(1).Shapes(1).Line.Weight = 5