M
Mark
I'm trying to find a specific table in a Word 2002 document by reading the
string in its first cell and comparing it to a fixed string. The code looks
like this:
Dim myTest as string
Dim myTable as Table
For tableNo = 1 To totalTables
Set myTable = ActiveDocument.Tables(tableNo)
myTest = myTable.Cell(1, 1).Range.Text
If myTest = "SomeUniqueWord" Then
blah, blah
The problem is that myTest contains the text from the table plus a couple of
strange characters at the end that show up as rectangles on my screen.
Nothing I have tried seems to get rid of those funny characters or allow me
to make a match on it. I've tried trim(), as well as other string cleaner
functions and I've tried StrComp() too. Either it won't match or I get a
type mismatch.
Is there some way to get just the visible characters from the cell?
Thanks, Mark
string in its first cell and comparing it to a fixed string. The code looks
like this:
Dim myTest as string
Dim myTable as Table
For tableNo = 1 To totalTables
Set myTable = ActiveDocument.Tables(tableNo)
myTest = myTable.Cell(1, 1).Range.Text
If myTest = "SomeUniqueWord" Then
blah, blah
The problem is that myTest contains the text from the table plus a couple of
strange characters at the end that show up as rectangles on my screen.
Nothing I have tried seems to get rid of those funny characters or allow me
to make a match on it. I've tried trim(), as well as other string cleaner
functions and I've tried StrComp() too. Either it won't match or I get a
type mismatch.
Is there some way to get just the visible characters from the cell?
Thanks, Mark