We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

DOCX saved is corrupted

I’ve attached the example document and here is the code I’m using:

Aspose.Words.Document doc = new Aspose.Words.Document("in.docx", Aspose.Words.LoadFormat.Docx, string.Empty);
doc.Save(ddlMergeDocs.SelectedValue , Aspose.Words.SaveFormat.Docx, Aspose.Words.SaveType.OpenInBrowser, HttpContext.Current.Response);

Event if I don’t modify the file, the file will not open once saved through Aspose.Words. It says it could be corrupted, it can however be “recovered” but this is far from ideal behavior. Any ideas?

Thanks for your request. I think that you should call Responsa.End() after saving document. Please try using the following code.

Document doc = new Document(Server.MapPath("PersonLabelsDOCX.docx"));
doc.Save("out.docx", SaveFormat.Docx, SaveType.OpenInWord, Response);

Hope this helps.
Best regards.

Thank you, that did indeed work. I guess I assumed the save took care of that since that code worked with 2003 formats. Weird but thank you very much!