Ok, I'm trying a different method now. As opposed to iterating through the tables and trying to find the position in the larger table, I'm iterating through all the cells of the large table and checking if there is a table in it, then removing the formatting from the row above.
Code:
Set LargeTable = ActiveDocument.Tables(1)
For Y = 0 to LargeTable.Rows.Count
For X = 0 to LargeTable.Columns.Count
If LargeTable.Cells(Y,X).Tables.Count = 0 Then
Next X
Else
LargeTable.Row(Y-1).ParagraphFormat.KeepWithNext = False
Next X
Next Y
However this is giving me an error here:
Code:
If LargeTable.Cells(Y,X).Tables.Count = 0 Then
Saying Object member does not exist. I'm also fairly certain my check to see if there is a table is going to fail as well.