LineStyle Property

Applies To

Border object.

Description

Returns or sets the border line style for the specified object. Read/write Long.

Can be one of the following WdLineStyle constants:

  • wdLineStyleDashDot
  • wdLineStyleDashDotDot
  • wdLineStyleDashDotStroked
  • wdLineStyleDashLargeGap
  • wdLineStyleDashSmallGap
  • wdLineStyleDot
  • wdLineStyleDouble
  • wdLineStyleDoubleWavy
  • wdLineStyleEmboss3D
  • wdLineStyleEngrave3D
  • wdLineStyleNone
  • wdLineStyleSingle
  • wdLineStyleSingleWavy
  • wdLineStyleThickThinLargeGap
  • wdLineStyleThickThinMedGap
  • wdLineStyleThickThinSmallGap
  • wdLineStyleThinThickLargeGap
  • wdLineStyleThinThickMedGap
  • wdLineStyleThinThickSmallGap
  • wdLineStyleThinThickThinLargeGap
  • wdLineStyleThinThickThinMedGap
  • wdLineStyleThinThickThinSmallGap
  • wdLineStyleTriple

Remarks

Setting the LineStyle property for a range that refers to individual characters or words applies a character border.

Setting the LineStyle property for a paragraph or range of paragraphs applies a paragraph border. Use the InsideLineStyle property to apply a border between consecutive paragraphs.

Setting the LineStyle property for a section applies a page border around the pages in the section.

See Also

Enable property, InsideLineStyle property, InsideLineWidth property, LineWidth property, OutsideLineStyle property.

Example

If the selection is a paragraph or a collapsed selection, this example adds a single 0.75-point paragraph border above the selection. If the selection doesn't include a paragraph, a border is applied around the selected text.

With Selection.Borders(wdBorderTop)
    .LineStyle = wdLineStyleSingle
    .LineWidth = wdLineWidth075pt
End With
This example adds a double 1.5-point border below each frame in the active document.

For Each aFrame In ActiveDocument.Frames
    With aFrame.Borders(wdBorderBottom)
        .LineStyle = wdLineStyleDouble
        .LineWidth = wdLineWidth150pt
    End With
Next aFrame
The following example applies a border around the fourth word in the active document. Applying a single border (in this example, a top border) to text applies a border around the text.

ActiveDocument.Words(4).Borders(wdBorderTop).LineStyle = wdLineStyleSingle