我想構建一個宏,用於選擇文檔中的每個表格,附加一行並將該行中第一個單元格的值設置爲「Text」。Microsoft Word宏:在第一個單元格中添加具有值的行
這是我現在有:
Sub AddProofRow()
Dim t As Table
For Each t In ActiveDocument.Tables
t.Rows.Add
NewRow = t.Rows.Last
NewRow.Cells(t.Rows.Count, 1).Value = "Proof"
Next
End Sub
但是,我得到的錯誤,當我運行它,我怎樣才能使這項工作?
't.Rows.Add.Cells(1).Range.Text =「TEXT」'但可能需要爲循環,而不是爲每個 – Slai