title: Word 2007 Remove section break
body: <p>I have a word 2007 <code>.doc</code> file that contains multiple sub documents separated by sections.</p>
  <p>Is there a way to remove all section breaks from the document?</p>
  <p>I have tried to Find and Replace them but I receive an error.</p>
  <pre><code>private void RemoveAllSectionBreaks(Word.Document doc)
  {
      Word.Find find = doc.Range(ref oMissing, ref oMissing).Find;
      find.ClearFormatting();
      //find.Text = &quot;^b&quot;; // This line throws an error
      find.Text =((char)12).ToString(); // Same error when attempting it this way
      find.Replacement.ClearFormatting();
      find.Replacement.Text = &quot;&quot;;
  
      find.Execute(ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, Word.WdReplace.wdReplaceAll, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
  }
  </code></pre>
  <p>The <code>find.Text</code> line will generate an error -</p>
  <blockquote>
  <p>SEHException was unhandled by user code</p>
  <p>External component has thrown an exception.</p>
  </blockquote>
  <p>I do not get any further details on what the error might have been.  The code is working okay in word 2003, but I need this working in Word 2007.</p>
  <p>Am I following the right approach for word 2007?</p>