title: Microsoft Interop saveAs command failed
body: <p>I have this simple console app that converts Word documents to PDF using Microsoft Office Interop API. For some reason, this one document always fails and I have attached it and removed all extraneous content: <a href="http://cl.ly/16132A2W0Y1a" rel="nofollow">click here</a>  </p>
  
  <p>For some reason, it works fine when you open the document and perform the saveAs function in Word, but through code, it fails. I've tried SaveAs2, SaveAs and ExportAsFixedFormat methods.  I'm running Office 2010 and using Microsoft Word 14.0 Object Library.  Thanks.</p>
  
  <p>My C# code is as follows</p>
  
  <pre><code>        Object missing = Type.Missing;
          String file = @"C:\Test\bad2.doc";
          Word.Application wordApp = null;
          Word.Document document = null;
          try
          {
              wordApp = new Word.Application();
              wordApp.Visible = false;
              document = wordApp.Documents.Open(file);
  
              document.SaveAs2(@"C:\Test\bad.pdf", Word.WdSaveFormat.wdFormatPDF);
          }
          catch (Exception ex)
          {
              Console.Write(ex);
          }
          finally 
          {
              if (document != null) 
              {
                  ((Word._Document)document).Close();
              }
              if (wordApp != null)
              {
                  ((Word._Application)wordApp).Quit(ref missing, ref missing, ref missing);
              }
              document = null;
              wordApp = null;
          }
  </code></pre>