title: Search and Replace Multiple Words
body: <p>I already have the code to do a search and replace in Microsoft Word using a VBA macro, but at the moment, my code is copying and pasting the same function multiple times. </p>
  
  <p>What I would like to do is have an dictionary of words that need to be replaced, so for example:</p>
  
  <p>old_word: new_word</p>
  
  <p>Then I have the VBA script to loop through and make the necessary changes in the document. </p>
  
  <p>My code for now is and repeats for each new word pair. </p>
  
  <pre><code>Sub change_words()
  
     With Selection.Find
          .Text = "optimize"
          .Replacement.Text = "optimise"
          .Forward = True
          .Wrap = wdFindContinue
          .MatchWholeWord = True
     End With
  
     Selection.Find.Execute Replace:=wdReplaceAll
  
     With Selection.Find
          .Text = "utilized"
          .Replacement.Text = "utilised"
          .Forward = True
          .Wrap = wdFindContinue
          .MatchWholeWord = True
     End With
  
     Selection.Find.Execute Replace:=wdReplaceAll
  
  End Sub 
  </code></pre>
  
  <p>Many thanks in advance</p>