title: To find and replace a text in the whole document in MS Word 2010 (including tables)
body: <p>I have an MS Word document including a table. I am trying to find and replace text via VBA using the following code:</p>
  
  <pre><code>If TextBox1.Text &lt;&gt; "" Then
      Options.DefaultHighlightColorIndex = wdNoHighlight
      Selection.Find.ClearFormatting
      Selection.Find.Replacement.ClearFormatting
      Selection.Find.Replacement.Highlight = True
      With Selection.Find
          .Text = "&lt;Customer_Name&gt;"
          .Replacement.Text = TextBox1.Text
          .Forward = True
          .Wrap = wdFindContinue
          .Format = False
          .MatchCase = False
          .MatchWholeWord = False
          .MatchWildcards = False
          .MatchSoundsLike = False
          .MatchAllWordForms = False
      End With
  
  Selection.Find.ClearFormatting
      With Selection.Find.Font
      .Italic = True
      End With
      Selection.Find.Replacement.ClearFormatting
      With Selection.Find.Replacement.Font
      .Italic = False
      End With
      Selection.Find.Execute Replace:=wdReplaceAll
      End If
  </code></pre>
  
  <p>This works fine for replacing all my content which is <strong>outside</strong> of the table. But it will not replace any of the content within the table.</p>