Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Highlight matching words of a dictionary

Status
Not open for further replies.

richiwatts

Technical User
Jun 21, 2002
180
GB
I am trying to create something that works like the spell checker in Word, however, I want to highlight any words that match those in my dictionary, where as word only highlights words that are not.

I have the code that does it but it highlights words wrongly, for example in my dictionary i have the word "added". If the word document I am checking has the word "add" it highlights it as a match. How can I change it so that it only highlights the words that exactly match those in my dictionary? This is what I have at the moment:

.Replacement.Text = &quot;^&&quot; ' <= code for &quot;found text&quot;
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
 
Hiya,

Logically, your first line is the answer.....

Replacement.Text = &quot;^&&quot; ' <= code for &quot;found text&quot;

maybe should be

Replacement.Text = &quot;^&&quot; ' = code for &quot;found text&quot;

where the '<' in '<= code' is actually allowing anything smaller when compared to the 'check word' is also allowed.

Hope this simple thing is it.

Regards,

Darrylle

&quot;Never argue with an idiot, he'll bring you down to his level - then beat you with experience.&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top