BackColor 属性

       

返回或设置一个 ColorFormat 对象,该对象代表指定填充对象或图案线条的背景色。可读写。

示例

下例向活动文档中添加一个矩形,然后设置矩形填充的前景色、背景色和过渡。

Dim docActive As Document

Set docActive = ActiveDocument

With docActive.Shapes.AddShape(msoShapeRectangle, _
        90, 90, 90, 50).Fill
    .ForeColor.RGB = RGB(128, 0, 0)
    .BackColor.RGB = RGB(170, 170, 170)
    .TwoColorGradient msoGradientHorizontal, 1
End With

本示例为活动文档添加图案线条。

Dim docActive As Document

Set docActive = ActiveDocument

With docActive.Shapes.AddLine(10, 100, 250, 0).Line
    .Weight = 6
    .ForeColor.RGB = RGB(0, 0, 255)
    .BackColor.RGB = RGB(128, 0, 0)
    .Pattern = msoPatternDarkDownwardDiagonal
End With