Border.ColorIndex property (Word)

Returns or sets the color for the specified border or font object. Read/write WdColorIndex.

Syntax

expression.ColorIndex

expression Required. A variable that represents a 'Border' object.

Remarks

The wdByAuthor constant is not valid for border and font objects.

Example

This example adds a dotted red border around each cell in the first table.

Dim borderLoop As Border 
 
If ActiveDocument.Tables.Count >= 1 Then 
 For Each borderLoop In ActiveDocument.Tables(1).Borders 
 With borderLoop 
 .ColorIndex = wdRed 
 .LineStyle = wdLineStyleDashDot 
 .LineWidth = wdLineWidth075pt 
 End With 
 Next borderLoop 
End If

See also

Border Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.