I am trying to find only words that are in all caps and replace them with a translated counterpart.
For example, I would like to replace the written number "ONE" with "UNO".
However, I am running into a problem that "one" appears in the foreign language in various words and is being replaced by "uno". I only need to replace the capitalized counterparts, is there a way to complete this?
This is the code I have been using;
'ONE
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "ONE"
.Replacement.Text = "UNO"
.Forward = False
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
A better option might be to only have it replace when it shows up as the whole word.
Edit: You just set .MatchWholeWord to true. -_- duh.