Class Borders (Word VBA)

A collection of Border objects that represent the borders of an object.

The classes Cell, Column, ConditionalStyle, Font, Frame, HTMLDivision, InlineShape, Paragraph, ParagraphFormat, Range, Row, Section, Selection, Style ... give access to class BordersTable, TableStyle.

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

Dim brds as Borders
Set brds = Selection.Borders
The following procedures can be used to set variables of type Borders: Cell.Borders, Cells.Borders, Column.Borders, Columns.Borders, ConditionalStyle.Borders, Font.Borders, Frame.Borders, HTMLDivision.Borders, InlineShape.Borders, Paragraph.Borders, ParagraphFormat.Borders, Paragraphs.Borders, Range.Borders, Row.Borders ...Rows.Borders, Section.Borders, Selection.Borders, Style.Borders, Table.Borders, TableStyle.Borders.

For Each

Here is an example of processing the Borders items in a collection.

Dim brd As Border
For Each brd In Selection.Borders
	
Next brd

Methods

ApplyPageBordersToAllSections - Applies the specified page-border formatting to all sections in a document.

Item - Returns a border in a range or selection.

Properties

AlwaysInFront true if page borders are displayed in front of the document text.

Count returns the number of items in the Borders collection.

DistanceFrom returns or sets a value that indicates whether the specified page border is measured from the edge of the page or from the text it surrounds.

DistanceFromBottom returns or sets the space (in points) between the text and the bottom border.

DistanceFromLeft returns or sets the space (in points) between the text and the left border.

DistanceFromRight returns or sets the space (in points) between the right edge of the text and the right border.

DistanceFromTop returns or sets the space (in points) between the text and the top border.

Enable returns or sets border formatting for the specified object.

EnableFirstPageInSection true if page borders are enabled for the first page in the section.

EnableOtherPagesInSection true if page borders are enabled for all pages in the section except for the first page.

HasHorizontal true if a horizontal border can be applied to the object.

HasVertical true if a vertical border can be applied to the specified object.

InsideColor returns or sets the 24-bit color of the inside borders.

InsideColorIndex returns or sets the color of the inside borders.

InsideLineStyle returns or sets the inside border for the specified object.

InsideLineWidth returns or sets the line width of the inside border of an object.

JoinBorders true if vertical borders at the edges of paragraphs and tables are removed so that the horizontal borders can connect to the page border.

OutsideColor returns or sets the 24-bit color of the outside borders.

OutsideColorIndex returns or sets the color of the outside borders.

OutsideLineStyle returns or sets the outside border for the specified object.

OutsideLineWidth returns or sets the line width of the outside border of an object.

Shadow true if the specified border is formatted as shadowed.

SurroundFooter true if a page border encompasses the document footer.

SurroundHeader true if a page border encompasses the document header.