Share via


Line Property

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Returns a LineFormat object that contains line formatting properties for the specified shape. (For a line, the LineFormat object represents the line itself; for a shape with a border, the LineFormat object represents the border.)

expression.Line

expression   Required. An expression that returns one of the objects in the Applies To list.

Example

This example adds a blue dashed line to the active publication.

  With ActiveDocument.Pages(1).Shapes _
        .AddLine(BeginX:=10, BeginY:=10, _
        EndX:=250, EndY:=250).Line
    .DashStyle = msoLineDashDotDot
    .ForeColor.RGB = RGB(50, 0, 128)
End With

This example adds a cross to the first page and then sets its border to be 8 points thick and red.

  With ActiveDocument.Pages(1).Shapes _
        .AddShape(Type:=msoShapeCross, _
        Left:=10, Top:=10, Width:=50, Height:=70).Line
    .Weight = 8
    .ForeColor.RGB = RGB(255, 0, 0)
End With