我在 MS word 中有一个 3 X 3(比如 tableA)表。第 (2,2) 个单元格是一个拆分单元格(拆分为 2X2 表)。如何循环遍历 tableA 中的所有单元格。
Dim strCellText As String
Dim uResp As String
Dim Row As Integer
Dim Col As Integer
Dim itable As Table
For Each itable In ThisDocument.Tables
uResp = ""
For Row = 1 To itable.Rows.Count
For Col = 1 To itable.Columns.Count
strCellText = itable.Cell(Row, Col).Range.Text
uResp = uResp & Trim(strCellText)
Next
Next
MsgBox uResp
Next
该程序给出了编译错误:
Run time error 5914
The requested member of the collection does not exist
如何迭代具有拆分单元格的表格的单元格。