title: Speed up multiple replacement
body: <p>I'm writing a Word macro that reads about 1000 word pairs from an Excel file and does replacement accordingly for a Word file. At the very beginning I was using the code below for the replacement:</p>
  
  <pre><code>    Selection.Find.ClearFormatting
      Selection.Find.Replacement.ClearFormatting
      With Selection.Find
          .Text = SrcText
          .Replacement.Text = DestText
          .Forward = True
          .Wrap = wdFindContinue
          .Format = False
          .MatchCase = False
          .MatchWholeWord = False
          .MatchByte = False
          .MatchAllWordForms = False
          .MatchSoundsLike = False
          .MatchWildcards = False
          .MatchFuzzy = False
      End With
      Selection.Find.Execute Replace:=wdReplaceAll
  </code></pre>
  
  <p>It worked but appeared a bit slow for large Word files. Then I tried to first read the whole content into a string variable, do finding there, then alter the Word file when any replacement target was found (although I'm actually not sure that this can be faster). </p>
  
  <p>When doing that I encountered <strong>a somewhat weird inconsistency</strong>. For example, if you create a Word file with only a single-cell table in the first row:</p>
  
  <p><img src="https://i.stack.imgur.com/9eUOu.jpg" alt="enter image description here"></p>
  
  <p>then in the VBA editor, the code below will give you 2.</p>
  
  <pre><code>    Debug.Print Len(ActiveDocument.Characters(2))
  </code></pre>
  
  <p>I don't know whether there exist other inconsistencies of this sort and got stuck there.</p>
  
  <p><strong>Is there any workaround or Is there any other way to speedup the replacement?</strong></p>