Skip to content
本页内容

Borders (属性)

返回一个代表表样式元素的边框的 Borders 集合。只读。

示例

python
#本示例将表格的上边框设置为红色实线的细边框
def test():
    border = Application.ActiveWorkbook.TableStyles.Item("Table Style 4").TableStyleElements.Item(xlWholeTable).Borders.Item(xlEdgeTop)
    border.Color = RGB(255, 0, 0)
    border.TintAndShade = 0
    border.Weight = xlThin
    border.LineStyle = xlContinuous
python
#本示例显示活动工作表上第一张列表中标题行样式元素的边框主题颜色是否为蓝色
def test():
    listObj = ActiveSheet.ListObjects.Item(1)
    print(listObj.TableStyle.TableStyleElements.Item(xlHeaderRow).Borders.ThemeColor == RGB(0, 0, 255))