该属性返回或设置一个 Long 类型的数值,当样式指定奇数或偶数行成组时,表示组中包含的行数。可读写。
expression.RowStripe
expression 必需。该表达式返回“应用于”列表中的一个对象。
使用 Condition 方法可设置用于表格样式的奇数或偶数列组。
本示例新建一个表格样式并设置其格式,然后将新样式应用于新的表格。该样式的结果使每隔三列的三列和每隔两行的两行具有 20% 的底纹。
Sub NewTableStyle()
Dim styTable As Style
With ActiveDocument
Set styTable = .Styles.Add(Name:="TableStyle 1", _
Type:=wdStyleTypeTable)
With .Styles("TableStyle 1").Table
.Condition(wdEvenColumnBanding).Shading _
.Texture = wdTexture20Percent
.ColumnStripe = 3
.Condition(wdEvenRowBanding).Shading _
.Texture = wdTexture20Percent
.RowStripe = 2
End With
With .Tables.Add(Range:=Selection.Range, NumRows:=15, _
NumColumns:=15)
.Style = ActiveDocument.Styles("TableStyle 1")
End With
End With
End Sub