title: OpenXML replace text in all document
body: <p>I have the piece of code below. I'd like replace the text "Text1" by "NewText", that's work. But when I place the text "Text1" in a table that's not work anymore for the "Text1" inside the table.</p>
  
  <p>I'd like make this replacement in the all document.</p>
  
  <pre><code>using (WordprocessingDocument doc = WordprocessingDocument.Open(String.Format("c:\\temp\\filename.docx"), true))
  {
      var body = doc.MainDocumentPart.Document.Body;
  
      foreach (var para in body.Elements&lt;Paragraph&gt;())
      {
          foreach (var run in para.Elements&lt;Run&gt;())
          {
              foreach (var text in run.Elements&lt;Text&gt;())
              {
                  if (text.Text.Contains("##Text1##"))
                      text.Text = text.Text.Replace("##Text1##", "NewText");
              }
          }
      }
  }
  </code></pre>