title: How to save doc file using C#
body: <p>I have been using the following to code to write in word file but not able to store the word file. Is there any way to store the word file using C# ?</p>
  
  <pre><code>object oMissing = System.Reflection.Missing.Value;
                  object oEndOfDoc = "\\endofdoc"; /* \endofdoc is a predefined bookmark */
                  //Start Word and create a new document.
                  Microsoft.Office.Interop.Word._Application oWord = new Microsoft.Office.Interop.Word.Application();
  
              Microsoft.Office.Interop.Word._Document oDoc = new Microsoft.Office.Interop.Word.Document();
  
              oWord.Visible = true;
  
              oDoc = oWord.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing);
  
              //Insert a paragraph at the beginning of the document.
              Microsoft.Office.Interop.Word.Paragraph oPara1;
  
              oPara1 = oDoc.Content.Paragraphs.Add(ref oMissing);
              oPara1.Range.Text = "Heading 1";
              oPara1.Range.Font.Bold = 1;
              oPara1.Format.SpaceAfter = 24;    //24 pt spacing after paragraph.
  </code></pre>