返回一个 ConditionalStyle 对象,该对象代表表格的一部分的特殊样式格式。
语法
expression。 Condition
( _ConditionCode_
)
expression 是必需的。 一个代表“TableStyle”对象的变量。
参数
名称 | 必需/可选 | 数据类型 | 说明 |
---|---|---|---|
ConditionCode | 必需 | WdConditionCode | 要对其应用格式的表的区域。 |
示例
本示例选定活动文档中的第一个表格,并为奇数列添加百分之二十的底纹。
Sub TableStylesTest()
With ActiveDocument
'Select the table to which the conditional
'formatting will apply
.Tables(1).Select
'Specify the conditional formatting
.Styles("Table Grid").Table _
.Condition(wdOddColumnBanding).Shading _
.BackgroundPatternColor = wdColorGray20
End With
End Sub
另请参阅
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。