BackgroundPatternColorIndex Property Example

This example applies cyan background shading to the first paragraph in the active document.

Set myRange = ActiveDocument.Paragraphs(1).Range
myRange.Shading.BackgroundPatternColorIndex = wdTurquoise

This example adds a table at the insertion point and then applies light gray background shading to the first cell.

Selection.Collapse Direction:=wdCollapseStart
Set myTable = ActiveDocument.Tables.Add(Range:=Selection.Range, _
    NumRows:=2, NumColumns:=2)
myTable.Cell(1, 1).Shading.BackgroundPatternColorIndex = wdGray25