CoxProg
2012-01-13 22:39:45 UTC
I am trying to test the contents of cells in a table. However, th
special character found in each table cell throws me off. I have som
options of getting around it (described below), but are there any othe
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 o
TextToTest on a cell that contains "Sought Value", I get:
Sought Value
(the next line contains a bullet looking thing that this window will no
let me paste into it)
That pesky character! :) I have rigged some ways around it b
calculating the length of the TextToTest (x) and then extracting x-
characters from the left.
But I am looking for an option that references that special characte
directly. Different threads suggest the special character is "^10" o
"^008" but my tests for those characters didn't seem to work.
Thanks in advance!
--
CoxProg
special character found in each table cell throws me off. I have som
options of getting around it (described below), but are there any othe
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 o
TextToTest on a cell that contains "Sought Value", I get:
Sought Value
(the next line contains a bullet looking thing that this window will no
let me paste into it)
That pesky character! :) I have rigged some ways around it b
calculating the length of the TextToTest (x) and then extracting x-
characters from the left.
But I am looking for an option that references that special characte
directly. Different threads suggest the special character is "^10" o
"^008" but my tests for those characters didn't seem to work.
Thanks in advance!
--
CoxProg