View Single Post
  #1   Report Post  
CoxProg CoxProg is offline
Junior Member
 
Posts: 1
Default Special Character at End of Each Table Cell

I am trying to test the contents of cells in a table. However, the special character found in each table cell throws me off. I have some options of getting around it (described below), but are there any other suggestions on how to work around this?

Here is my simplified code:

Dim TextToTest As String

TextToTest = ActiveDocument.Tables(1).Cell(Row:=1, Column:=1).Range.Text

If TextToTest = "Sought Value" Then
MsgBox "True"
Else
MsgBox "False"
End If

My result is always "False." When I look at the extracted value of TextToTest on a cell that contains "Sought Value", I get:

Sought Value
(the next line contains a bullet looking thing that this window will not let me paste into it)

That pesky character! I have rigged some ways around it by calculating the length of the TextToTest (x) and then extracting x-2 characters from the left.

But I am looking for an option that references that special character directly. Different threads suggest the special character is "^10" or "^008" but my tests for those characters didn't seem to work.

Thanks in advance!