G
Guest
I have some VB code that will loop through all tables in a document and
perform certain formatting functions on selected tables. To decide which are
the selected tables I need to test a cell.
How can I test the value of a cell? I have tried the following...
Dim pCell As Word.Cell
Dim pTable As Word.Table
For Each pTable In ActiveDocument.Tables
MsgBox pTable.Cell(2,1) 'This works
If pTable.Cell(2, 1) = "MyValue" Then 'This does NOT work
.... formatting instructions
End If
Next
perform certain formatting functions on selected tables. To decide which are
the selected tables I need to test a cell.
How can I test the value of a cell? I have tried the following...
Dim pCell As Word.Cell
Dim pTable As Word.Table
For Each pTable In ActiveDocument.Tables
MsgBox pTable.Cell(2,1) 'This works
If pTable.Cell(2, 1) = "MyValue" Then 'This does NOT work
.... formatting instructions
End If
Next