title: Set Range.Text without breaking Fields?
body: <p>I need to remove some text from a Word document footer which also contains fields (e.g. for the page number). Simple, right? </p>
  
  <p>However, when I update the text in the range it breaks the fields that it contains. For example, the page number field becomes just a number (rather than a field which stays up to date).</p>
  
  <p>Is there a way to change the text in a range without affecting the fields it contains?</p>
  
  <p>Here is my current code:     </p>
  
  <pre><code>string wordToRemove = "foo";            
  
  foreach (Section section in doc.Sections)
  {
      foreach (HeaderFooter footer in section.Footers)
      {
          if (footer.Range.Text.Contains(wordToRemove))
              footer.Range.Text = footer.Range.Text.Replace(wordToRemove, "");
      }
  }
  </code></pre>