Quote:
Originally Posted by Nicknamednick
However, when I ran the macro on a regular document, it had less than desirable effects. Many of the words were bolded, but some were only partially bolded.
|
Words that are partially bolded indicate that your Find terms didn't include the whole of those words. This is a problem that arises from having both single words and phrases in the same list, as one can't use:
.MatchWholeWord = True
when phrases are present. One way around that would be to test each term for the presence of one or more spaces. For example:
Code:
'Process each string from the List
For i = 1 To UBound(Split(xlFList, "|"))
If UBound(Split(Split(xlFList, "|")(i), " ")) = 0 Then
.MatchWholeWord = True
Else
.MatchWholeWord = False
End If
.Text = Split(xlFList, "|")(i)
.Replacement.Text = "^&"
.Execute Replace:=wdReplaceAll
Next
Quote:
Originally Posted by Nicknamednick
It also made many words bold that I would not have intended.
|
I can't see how the macro code could cause that. Perhaps your list is more expansive than you thought.