5,139
社区成员
发帖
与我相关
我的任务
分享
Sub test()
Dim i As Integer
Dim iTblCount As Integer
Dim iRowCount As Integer
Dim oDoc As Document
Dim oTbl As Table
Set oDoc = ActiveDocument
iTblCount = oDoc.Tables.Count
For i = 1 To iTblCount
Set oTbl = oDoc.Tables(i)
iRowCount = oTbl.Rows.Count
oTbl.Cell(iRowCount - 2, 1).Select
If Selection.Shading.BackgroundPatternColor <> wdColorGray15 Then
oTbl.Cell(iRowCount, 1).Select
Selection.InsertRowsBelow 1
End If
Next i
End Sub