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

Free Support Forum - aspose.com

Help: Word document includes the web page html (embedded)

Hi,

I have a web page that outputs a word doc to the Response object allowing the users to open or save it. However, when I enabled macros, I get a error popup in word saying that it could not find a css file (which my web page uses). I was not sure why because the word document does not refer to any styles used in my web page.

So I saved the word docuemnt from the Response as filename.xml. Then I opened it in notepad. There were a lot of asci charectors (because when I saved, I selected "All Files" as the filetype and put filename.XML) and saved it) but towards the end of the file, I saw the entire html for that page from where I downloaded the document.

This is causing an issue because we need macros enabled for our clients. Here's the save method (response object comes in as a parameter):

document.Save("Sample.doc", SaveFormat.Doc, SaveType.OpenInApplication, response);

Any help would be greatly appreciated!

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. You should just add Response.End() and shown below:

doc.Save("test.doc", SaveFormat.Doc, SaveType.OpenInApplication, Response);

Response.End();

Hope this helps.

Best regards.