title: Word VBA - run through doc and use excel sheet for replacement text
body: <p>I'm trying to create a macro that does the following:</p>
  
  <p>Run through the document and look for strings of the format ##. The items I'm looking for are numbers so they will always be ##014, ##054, etc. If it finds a string containing ##...,it needs to search the excel worksheet CodesNew.xls in My Documents. If it finds a matching string in Column A, it needs to replace the string in the word document with the value in Column B. Now comes the tricky part! The value needs to be entered as a mergefield.</p>
  
  <p>All I have now is search a Word doc and replace it.</p>
  
  <pre><code>Selection.Find.ClearFormatting
  Selection.Find.Replacement.ClearFormatting
  With Selection.Find
     .Text = "##*"
     .Replacement.Text = "KDKKD"
     .Forward = True
     .Format = False
     .MatchCase = False
     .MatchWholeWord = False
     .MatchWildcards = True
     .MatchSoundsLike = False
     .MatchAllWordForms = False
  End With
  Selection.Find.Execute Replace:=wdReplaceAll
  </code></pre>