OutsideColorIndex Property

Microsoft Word Visual Basic

Show All

OutsideColorIndex Property

       

Returns or sets the color of the outside borders. Read/write WdColorIndex.

WdColorIndex can be one of these WdColorIndex constants.
wdAuto
wdBlack
wdBlue
wdBrightGreen
wdByAuthor
wdDarkBlue
wdDarkRed
wdDarkYellow
wdGray25
wdGray50
wdGreen
wdNoHighlight
wdPink
wdRed
wdTeal
wdTurquoise
wdViolet
wdWhite
wdYellow

expression.OutsideColorIndex

expression   Required. An expression that returns a Borders object.

Remarks

If the OutsideLineStyle property is set to either wdLineStyleNone or False, setting this property has no effect.

Example

This example adds borders between rows and between columns in the first table of the active document, and then it sets the colors for both the inside and outside borders.

If ActiveDocument.Tables.Count >= 1 Then
    Set myTable = ActiveDocument.Tables(1)
    With myTable.Borders
        .InsideLineStyle = True
        .InsideColorIndex = wdBrightGreen
        .OutsideColorIndex = wdPink
    End With
End If

This example adds a red, 0.75-point double border around the first paragraph in the active document.

With ActiveDocument.Paragraphs(1).Borders
    .OutsideLineStyle = wdLineStyleDouble
    .OutsideLineWidth = wdLineWidth075pt
    .OutsideColorIndex = wdRed
End With