Match Case in Find does not work.
I am attempting to find text with no regards to case. ".MatchCase = False" (or true) does not work.
This is what I am using:
With Selection.Find .Forward = True
.MatchWholeWord = True
.MatchCase = False
.Wrap = wdFindContinue
.Font.Bold = False 'If I DONT put his in, it will only find Bold text
.Execute FindText:="Client"
End With
The word "client" below will not be found / selected.
".......bla bla bla client bla bla bla"
Here it will find and select the word "Client" , even with matchcase=False.
".......bla bla bla Client bla bla bla"
Thanks for any help
Match Case in Find does not work
OK,
I did not realize that Word could record all of the options while recording. Here is what it recorded when I ran the recorder, which works.
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Client"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Font.Bold = True
End With
Selection.Find.Execute
I added the ".Font.Bold=True" , which also pays attention to bold words.
Thanks all for your input.
Mike
Match Case in Find does not work
OK,
After a lot more research,
".MatchWildCards" =True will render ".MatchCase" =False useless.
You can not search case insensitive. A search for "Mike * Johnson" will not find find "mike tom johnson", and a search for "Mike" will not find "mike'
Thanks Microsoft.
Mike