title: How to use VBA to search for a list of words and phrases in a Word document and highlight them?
body: <p>So I have a large list of words and phrases that should not be used in a word document. I would like to write a macro to search a document for these words and phrases and highlight them.</p>
  
  <p>So far I have found and edited some code to search for specific words and it'll highlight those:</p>
  
  <pre><code>Sub Find_Liability_Words()
  '
  ' Find_Liability_Words Macro
  '
  '
  Application.ScreenUpdating = False
  Options.DefaultHighlightColorIndex = wdBrightGreen
  Dim StrFnd As String, i As Long, StrRpt As String
  
  ' Words to search for
  StrFnd = "actually,administer,advise,affirmative,all,always"
  
  With ActiveDocument.Range.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Replacement.Highlight = True
    .Forward = True
    .Wrap = wdFindContinue
    .Format = True
    .MatchCase = False
    .MatchWholeWord = True
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = True
    For i = 0 To UBound(Split(StrFnd, ","))
      .Text = Split(StrFnd, ",")(i)
      .Replacement.Text = "^&amp;"
      .Execute Replace:=wdReplaceAll
      If .Found = True Then StrRpt = StrRpt &amp; vbCr &amp; Split(StrFnd, ",")(i)
    Next
  End With
  If StrRpt = "" Then
    MsgBox "None of the terms were found.", vbOKOnly
  Else
    MsgBox "The following terms were found:" &amp; StrRpt, vbInformation
  End If
  Application.ScreenUpdating = True
  
  End Sub
  </code></pre>
  
  <p>Now the issue is that this can only do words and shows an error when trying to find to words together (such as "adequate number"). I am wondering how to make it search for a phrase as well.</p>
  
  <p>In addition to this, the list of words and phrases I'd like to search for is long and could change so editing the code for this could be tedious. Is it possible to have this code refer to a text file or an excel sheet in order to find it's words and phrases?</p>
  
  <p>Thank you so much for any help!!</p>