I recently upgraded from a (quite old) version of Aspose Words to version 22.214.171.124. Before that I had to work with .doc version of documents, but I convinced the client to upgrade so that we could work with .docx documents. Most of the documents we use are stored documents that are opened by the .Net code, data is inserted at bookmark locations and then the document is saved to the response so the user can decide what to do with it. When they go to open the documents straight from the browser, they get the “We’re sorry … the file cannot be opened because there are problems with the contents” error. If the document is saved and then opened it is fine. There is nothing especially complicated in the documents. The error happens even if it’s essentially a blank document with three bookmarks that have text inserted. I have changed the Save method to use this method:
Dim options As New OoxmlSaveOptions()
options.SaveFormat = SaveFormat.Docx
doc.Save(My.Response, “mydoc.docx”, ContentDisposition.Inline, options)
Are there methods in the basic build of the document that I need to change to make this work properly? The client is pretty annoyed with it and is asking me to go back to .doc versions which would be a shame. If it’s helpful I can upload both the blank document and the resulting completed one.
Can you help?