OK. So now I have all these tables in a document, and I've deleted contents of cells i don't want.

Now I want to rip through the document getting rid of all empty cells (after which I'll convert all tables to tabs).

The code below uses the collection of tables for the outer loop, but reverts to an integer For-loop for the inner loops. I've had very little success in looping through a collection of objects where I'm deleting (or even modifying!) some of the objects in the collection.

<pre>Sub udf_RemoveEmptyCells()
' Procedure : udf_RemoveEmptyCells
' Description: Remove all empty cells from all tables in the active document.
' By: Chris Greaves Inc.
' Inputs: None.
' Returns: None
' Assumes: Nothing
' Side Effects: None.
' Tested: By a call from the user.

Dim tbl As Table
For Each tbl In ActiveDocument.Tables
' Can't For-loop on a collection when we are deleting members of the collection.
Dim iRow As Integer
Dim iCol As Integer
For iRow = tbl.Rows.Count To 1 Step -1
For iCol = tbl.Columns.Count To 1 Step -1
' Here I should really make use of Function boolOnlyWhiteSpace
If Len(tbl.Cell(Row:=iRow, Column:=iCol).Range.Text) <= 2 Then
tbl.Cell(Row:=iRow, Column:=iCol).Delete
Else
End If
Next iCol
Next iRow
Next tbl
End Sub
</pre>