Cell.BorderRight 属性 (Publisher)
返回一个 CellBorder 对象,该对象代表指定表格单元格的右边框。
语法
表达式。BorderRight
表达 一个代表 Cell 对象的变量。
返回值
CellBorder
示例
此示例使用边框和填充颜色和现有表格来创建棋盘设计。 这假定第二页上的第一个形状是表格,而不是另一种类型的形状,并且该表的列数不均匀。
Sub FillCellsByRow()
Dim shpTable As Shape
Dim rowTable As Row
Dim celTable As Cell
Dim intCell As Integer
intCell = 1
Set shpTable = ActiveDocument.Pages(2).Shapes(1)
For Each rowTable In shpTable.Table.Rows
For Each celTable In rowTable.Cells
With celTable
With .BorderBottom
.Weight = 2
.Color.RGB = RGB(Red:=0, Green:=0, Blue:=0)
End With
With .BorderTop
.Weight = 2
.Color.RGB = RGB(Red:=0, Green:=0, Blue:=0)
End With
With .BorderLeft
.Weight = 2
.Color.RGB = RGB(Red:=0, Green:=0, Blue:=0)
End With
With .BorderRight
.Weight = 2
.Color.RGB = RGB(Red:=0, Green:=0, Blue:=0)
End With
End With
If intCell Mod 2 = 0 Then
celTable.Fill.ForeColor.RGB = RGB _
(Red:=180, Green:=180, Blue:=180)
Else
celTable.Fill.ForeColor.RGB = RGB _
(Red:=255, Green:=255, Blue:=255)
End If
intCell = intCell + 1
Next celTable
Next rowTable
End Sub
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈