D
DaveP
I'm trying to find a particular string in a number of documents, and this
string contains special characters - specificially the carat "^" symbol. I'm
able to open a sample document in Word and do a find on the string I'm
interested in, and I find it with no problem. But when I try to do this
programmatically with VBA, I don't find the string.
This is the code I'm using, which doesn't seem to work:
' there is code before this to select the Word range
(objRange)
objRange.Find.Text = "^tCo^p"
objRange.Find.MatchCase = False
If objRange.Find.Execute = True Then
'Success!!
End If
This code works if I'm searching for normal text, but not when I include the
carats. Does anyone know how this should be done? Thanks in advance!
string contains special characters - specificially the carat "^" symbol. I'm
able to open a sample document in Word and do a find on the string I'm
interested in, and I find it with no problem. But when I try to do this
programmatically with VBA, I don't find the string.
This is the code I'm using, which doesn't seem to work:
' there is code before this to select the Word range
(objRange)
objRange.Find.Text = "^tCo^p"
objRange.Find.MatchCase = False
If objRange.Find.Execute = True Then
'Success!!
End If
This code works if I'm searching for normal text, but not when I include the
carats. Does anyone know how this should be done? Thanks in advance!