I have a trial application where the user can download the document they've constructed as a word 2003 (doc), word 2007 (docx) or pdf version.
The document is constructed on the fly and saved as a .doc which works fine. To send it to the browser as a pdf or .docx I open the document and then do a document.save passing it the response to send it out as a either a pdf or docx. The code is as follows:
private void convertDoc(string currentDoc, string currentExtension, string externalName, string reqFormat)
Document inDoc = new Document(currentDoc);
inDoc.Save(externalName + reqFormat, (reqFormat != ".docx") ? SaveFormat.Pdf : SaveFormat.Docx, SaveType.OpenInApplication, Response);
The PDF created is fine, the docx created opens fine in Office 2007, but will not open in Office 2010. I've attached the docx file.
This isn't a huge deal as our client will not be on Office 2010 for a couple of years.