I'm trying to build a macro for Word that will go through every table and remove any line spacing from the text and then resize the tables to match.
I have the following code:
For Each tbl In ActiveDocument.Tables
For Each r In tbl.Rows
r.SetHeight RowHeight:=0.1, HeightRule:=wdRowHeightAtLeast
Next
Next
However this returns
Run-time error '5991': "Cannot access individual rows in this collection because the table has vertically merged cells."
on the line For Each r In tbl.Rows
The merged cells are in the two-row-header of the table so I'm happy to ignore them in the process. How then would I do a For Each
that skips the first two values of tbl.Rows
?