Shading.BackgroundPatternColor property (Word)

Returns or sets the 24-bit color that's applied to the background of the Shading object. Read/write.

Syntax

expression. BackgroundPatternColor

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

Remarks

This property can be any valid WdColor constant or a value returned by Visual Basic's RGB function.

Example

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

Set myRange = ActiveDocument.Paragraphs(1).Range 
myRange.Shading.BackgroundPatternColor = _ 
 wdColorTurquoise

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.BackgroundPatternColor = _ 
 wdColorGray25

See also

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