返回或设置应用于 Shading 对象的背景色。 WdColorIndex,可读写。
WdColorIndex 可以是这些 WdColorIndex 常量之一。 |
wdAuto |
wdBlack |
wdBlue |
wdBrightGreen |
wdByAuthor |
wdDarkBlue |
wdDarkRed |
wdDarkYellow |
wdGray25 |
wdGray50 |
wdGreen |
wdNoHighlight |
wdPink |
wdRed |
wdTeal |
wdTurquoise |
wdViolet |
wdWhite |
wdYellow |
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