title: c# word interop find and replace everything
body: <p>I have some code to replace text inside a word 2010 docx.</p>
  
  <pre><code>        object fileName = Path.Combine(System.Windows.Forms.Application.StartupPath, "document.docx");
  
          Microsoft.Office.Interop.Word.Application wordApp = new Microsoft.Office.Interop.Word.Application { Visible = true };
  
          Microsoft.Office.Interop.Word.Document aDoc = wordApp.Documents.Open(ref fileName, ReadOnly: false, Visible: true);
  
          aDoc.Activate();
  
          Microsoft.Office.Interop.Word.Find fnd = wordApp.ActiveWindow.Selection.Find;
  
          fnd.ClearFormatting();
          fnd.Replacement.ClearFormatting();
          fnd.Forward = true;
  
          fnd.Wrap = Microsoft.Office.Interop.Word.WdFindWrap.wdFindContinue;
  
          fnd.Text = "{id}";
          fnd.Replacement.Text = "123456";
          fnd.Execute(Replace: WdReplace.wdReplaceAll);
  </code></pre>
  
  <p>This works without formatting. But when {id} is formatted it does not replace the text.</p>
  
  <p>How can I make this code ignore formatting?</p>