返回或设置一个 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