BackgroundPatternColorIndex 属性

       

返回或设置应用于 Shading 对象的背景色。 WdColorIndex,可读写。

expression.BackgroundPatternColorIndex

expression   必需。该表达式返回“应用于”列表中的一个对象。

示例

本示例将活动文档的第一段底纹背景色设置为青色。

Dim rngTemp As Range

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

本示例将在插入点添加一个表格,并且将浅灰色背景底纹应用于该表格的第一个单元格。

Dim tableNew As Table

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