A stupid find question (1 Viewer)

The Rev

Registered User.
Local time
Today, 17:36
Joined
Jan 15, 2003
Messages
118
I need to find a string in a textbox on a PowerPoint slide I am filling from my database. I need to replace the entire string <with quotes> with the word Observation:

"Other than Satisfied" requirements


I have

xh = objShape.TextFrame.TextRange.Find("Other Than Satisfied")
If xh = ("Other Than Satisfied") Then
objShape.TextFrame.TextRange.Text = "Observations"
End If


The problem as it sits is that I have another text box on the slide that may or may not contain the words Other than Satisfied in the string. Never with quotes around them though. So I want to only search for "Other than Satisfied" but not Other than Satisfied. How can I fix my code to do that?
 

Minty

AWF VIP
Local time
Today, 22:36
Joined
Jul 26, 2013
Messages
10,371
Use the whole words option for the finding operation

And search for the quotes

Code:
strSearch =  Chr(34) & "Other Than Satisfied" & Chr(34)
xh = objShape.TextFrame.TextRange.Find(strSearch)
 

The Rev

Registered User.
Local time
Today, 17:36
Joined
Jan 15, 2003
Messages
118
Use the whole words option for the finding operation

And search for the quotes

Code:
strSearch =  Chr(34) & "Other Than Satisfied" & Chr(34)
xh = objShape.TextFrame.TextRange.Find(strSearch)

See? I always forget about the Chr objects... Appreciate the assist!!
 

NauticalGent

Ignore List Poster Boy
Local time
Today, 17:36
Joined
Apr 27, 2015
Messages
6,341
REV!

I see you're from Chester, VA...we're neighbors! Actually, I lived directly across from Shoosmith until I moved my wife and her
parents out to S. Prince George. There is another member here who is from Richmond but we do not see much of him anymore.

Small world...
 

Users who are viewing this thread

Top Bottom