Borders Property Example

This example applies inside and outside borders to the first table in the active document.

Set myTable = ActiveDocument.Tables(1)
With myTable.Borders
    .InsideLineStyle = wdLineStyleSingle
    .OutsideLineStyle = wdLineStyleDouble
End With

This example applies a border around the first character in the selection. If nothing is selected, the border is applied to the first character after the insertion point.

Selection.Characters(1).Borders.Enable = True

This example applies a bottom border below all centered paragraphs in the active document.

For Each para In ActiveDocument.Paragraphs
    If para.Alignment = wdAlignParagraphCenter Then
        para.Borders(wdBorderBottom).LineStyle = wdLineStyleSingle
        para.Borders(wdBorderBottom).LineWidth = wdLineWidth300pt
    End If
Next para

This example adds a border around all of the pages in the current section.

For Each aBorder In Selection.Sections(1).Borders
    aBorder.ArtStyle = wdArtBasicBlackDots
    aBorder.ArtWidth = 6
Next aBorder