title: C# save word document without prompt give 'document is opened elsewhere error'
body: <p>I have a windows form with Office Word inside it. I am opening word documents programmatically with code (_wd is of type Microsoft.Office.Interop.Word.ApplicationClass - I am using VS 2012, .NET 4.5, Office 2007):</p>
  
  <blockquote>
  <pre><code> public void LoadComponent(string path)
      {            
          if (_wd.Documents.Count != 0) _wd.ActiveDocument.Close(); 
          _wd.Documents.Add(ref path);
      }
  </code></pre>
  </blockquote>
  
  <p>My problem comes when I want to save active document. I don't want save prompt to appear - here's what I've tried, and couldn't cancel the prompt dialog:</p>
  
  <blockquote>
    <blockquote>
      <p>_wd.ActiveDocument.Saved = true;<br>
      _wd.ActiveDocument.Save();</p>
    </blockquote>
  </blockquote>
  
  <p>If I try with:</p>
  
  <blockquote>
    <p>_wd.ActiveDocument.SaveAs(_filePath, Type.Missing, Type.Missing, Type.Missing,
                                              Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                                              Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                                              Type.Missing, Type.Missing);</p>
  </blockquote>
  
  <p>I receive Exception: 'Word cannot save this file because it is already open elsewhere.' - but it is opened only inside my application, nowhere else. How to save Word document which is opened without save prompt dialog programmatically? Interesting thing is that even if I try to save the document by pressing 'save' button I got save prompt dialog -> like the document was not created before on disc. But, the document is opened from disc, only it is opened programmatically. If I open the document with Word and then press 'save' I never got save prompt dialog.</p>