Word VBA教程:Table属性

该属性返回一个 TableStyle对象,该对象代表可通过使用表格样式应用于表格的属性。


expression   必需。该表达式返回一个Style对象。



Sub NewTableStyle()
    Dim styTable As Style
    Set styTable = ActiveDocument.Styles.Add( _
        Name:="TableStyle 1", Type:=wdStyleTypeTable)
    With styTable.Table
        'Apply borders around table, a double border to the heading row,
        'a double border to the last column, and shading to last row
        .Borders(wdBorderTop).LineStyle = wdLineStyleSingle
        .Borders(wdBorderBottom).LineStyle = wdLineStyleSingle
        .Borders(wdBorderLeft).LineStyle = wdLineStyleSingle
        .Borders(wdBorderRight).LineStyle = wdLineStyleSingle
        .Condition(wdFirstRow).Borders(wdBorderBottom) _
            .LineStyle = wdLineStyleDouble
        .Condition(wdLastColumn).Borders(wdBorderLeft) _
            .LineStyle = wdLineStyleDouble
        .Condition(wdLastRow).Shading _
            .BackgroundPatternColor = wdColorGray125
    End With
End Sub

Word VBA教程

Word VBA参考教程:目录1 Word VBA参考教程:目录2
Word VBA参考教程:目录3 Word VBA参考教程:目录4
Word VBA参考教程:目录5 Word VBA参考教程:目录6
Word VBA参考教程:目录7 Word VBA参考教程:目录8
Word VBA参考教程:目录9 Word VBA参考教程:目录10
版权所有 © 中山市飞娥软件工作室 证书:粤ICP备09170368号