'设置单元格的行列坐标并写的word文档中
Sub SetTablePosition()
Dim tbl As Table
Dim cell As cell
Dim tblIndex As Integer
Dim cellContent As String
'以下遍历表格中存在的单元格
For Each tbl In ThisDocument.Tables
tblIndex = tblIndex + 1
Row = 1
col = 1
Do While (1)
Set cell = tbl.cell(Row, col)
If Not cell Is Nothing Then '如果单元格存在
Debug.Print cell.RowIndex
word合并单元格后,VBA读取设置相应单元格内容
最新推荐文章于 2025-10-12 12:40:13 发布
本文档的VBA代码示例演示如何遍历并读取Word文档中的表格单元格,特别是在合并单元格后,设置相应单元格的内容。通过选择单元格并获取其内容,然后更新为特定格式的文本。

最低0.47元/天 解锁文章
815

被折叠的 条评论
为什么被折叠?



