全部显示

Color 属性

       

该属性返回或设置指定的 BorderFont 对象的 24 位颜色。该属性值可以是任何有效的 WdColor 常量或 Visual Basic 的 RGB 函数返回的值。

expression.Color

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

示例

本示例将活动文档中第一段的文字颜色更改为绿色。

ActiveDocument.Paragraphs(1).Range.Font.Color = wdColorGreen

本示例将所选文字的颜色更改为深红色。

Selection.Font.Color = wdColorDarkRed

本示例在第一个表格中每个单元格周围添加靛蓝色的点划线边框。

If ActiveDocument.Tables.Count >= 1 Then
    For Each aBorder In ActiveDocument.Tables(1).Borders
        aBorder.Color = wdColorIndigo
        aBorder.LineStyle = wdLineStyleDashDot
        aBorder.LineWidth = wdLineWidth075pt
    Next aBorder
End If