Cell 对象 (Publisher)
代表单个表格单元格。 单元格 对象是 矩形 的成员 集合。 矩形 集合表示在指定的对象中的所有单元格。
备注
使用 Cells (索引) (其中 index 是单元格编号)返回 Cell 对象。
示例
本示例合并指定表格的第一列的前两个单元格。
Sub MergeCell()
With ActiveDocument.Pages(1).Shapes(2).Table.Columns(1)
.Cells(1).Merge MergeTo:=.Cells(2)
End With
End Sub
以下示例对指定表格的第二列中的第一个单元格应用粗边框。
Sub OutlineBorderCell()
With ActiveDocument.Pages(1).Shapes(2).Table.Columns(2).Cells(1)
.BorderLeft.Weight = 5
.BorderRight.Weight = 5
.BorderTop.Weight = 5
.BorderBottom.Weight = 5
End With
End Sub
方法
属性
- Application
- BorderBottom
- BorderDiagonal
- BorderLeft
- BorderRight
- BorderTop
- CellTextOrientation
- 列
- 对角线
- Fill
- HasText
- Height
- MarginBottom
- MarginLeft
- MarginRight
- MarginTop
- Parent
- 行
- Selected
- TextRange
- VerticalTextAlignment
- Width
另请参阅
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈