'设置单元格的行列坐标并写的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
Debug.Print cell.ColumnIndex
'TO-DO**********************************************************************
cell.Select
cellContent = Selection.Text
'If Len(Trim(content)) <> 0 Then GoTo nextCell
Selection.Text
word合并单元格后,VBA读取设置相应单元格内容
最新推荐文章于 2023-10-11 22:23:14 发布