Borders Property
Applies To
Cell object, Cells collection object, Column object, Columns collection object, Font object, Frame object, InlineShape object, Paragraph object, ParagraphFormat object, Paragraphs collection object, Range object, Row object, Rows collection object, Section object, Selection object, Style object, Table object.
Description
Returns a Borders collection that represents all the borders for the specified object. Read/write.
See Also
Enable property, InsideColorIndex property, InsideLineStyle property, InsideLineWidth property, OutsideColorIndex property, OutsideLineStyle property, OutsideLineWidth property, Shadow 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