title: DowngradeDocument() function not doing proper downgrade?
body: <p>I am trying to downgrade a document using VSTO.</p>
  
  <p>I have a webservice, that receive a byte array. This byte is from the current active document.</p>
  
  <p>The webservice can only handle a 2007/2003 word doc file.</p>
  
  <p>So I want to use the </p>
  
  <p>document.DowngradeDocument();</p>
  
  <p>But the webservice report an error, when sending the byte array.
  If a do a SaveAs and force word to save as 2007/2003 doc format, then there is no problem.</p>
  
  <p>So my question is:</p>
  
  <p>1) Why is DowngradeDocument() function not working. Why is it not doing a proper downgrade.
  2) Do I need to do something else when I have called DowngradeDocument()</p>
  
  <p>This must be in memory, since the file a happen to be working on, is not saved on disk.</p>
  
  <p>// Dennis</p>
  
  <p>Thank you for taking the time to read this</p>
  
  <p>--- edit d. 20120904 ---</p>
  
  <p>I cant use the webservice error, since it does not make sense of the error.
  It says that it can finde the file, and this is an error within and application at the other side.</p>
  
  <p>So I have tryed, to save a document in the right format, and one that was downgraded.
  Used the same code. One work and the other did not.</p>
  
  <p>But here is how I save the file as a temp. Before I call this function I have done a document.DowngradeDocument();</p>
  
  <p>So I need, when it save to also change the format, while calling the downgrade function.
  In the documentation for this function, it is clear that all previous version of office can read it, if the function is called.</p>
  
  <pre><code>/// &lt;summary&gt;
  /// Make a copy of ActiveDocument in current user temp folder, and get a byte[].
  /// &lt;/summary&gt;
  /// &lt;param name="filename"&gt;&lt;/param&gt;
  /// &lt;param name="document"&gt;&lt;/param&gt;
  /// &lt;param name="file"&gt;&lt;/param&gt;
  /// &lt;returns&gt;&lt;/returns&gt;
  private byte[] MakeCopy(string filename, Document document, out FileInfo file)
  {
    // http://blogs.msdn.com/b/pranavwagh/archive/2008/04/03/how-to-do-a-save-copy-as-in-word.aspx
    // http://stackoverflow.com/questions/12175273/serialize-current-activedocument-from-office-2007-add-in
  
    Microsoft.Office.Interop.Word.Application wdApp = new Microsoft.Office.Interop.Word.Application();
    wdApp.Visible = false;
    {
      // make a fil i Current user temp folder
      // http://stackoverflow.com/questions/944483/how-to-get-temporary-folder-for-current-user
      string tempPath = System.IO.Path.GetTempPath();
  
      string fileName = Path.Combine(tempPath, GenerateValidFileName(filename)) + ".doc";
  
      IPersistFile compoundDocument = document as IPersistFile;
      compoundDocument.Save(fileName, false);
  
      byte[] content = File.ReadAllBytes(fileName);
  
      file = new FileInfo(fileName);
      wdApp.Quit();
  
      return content; 
    }
  }
  </code></pre>