Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ColorIndex Property

Office 2003

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.ColorIndex

expression Required. An expression that returns one of the objects in the Applies To list.

Remarks

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

Example

This example changes the color of the text in the first paragraph in the active document.

ActiveDocument.Paragraphs(1).Range.Font.ColorIndex = wdGreen
		

This example formats the selected text to appear in red.

Selection.Font.ColorIndex = wdRed
		

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
		


Applies to | Border Object | Font Object



Show:
© 2014 Microsoft