Word Save and OpenInBrowser option not working in word 2003

Hi

document.Save(wordfilename.ToString(), SaveFormat.Doc, SaveType.OpenInBrowser, monresponse);

This statement is not working on machine with word 2003. It runs for a wile the hourglass appears and i can see the word loaded in taskmanager but the document is not opening. Is there a different syntax for word 2003
I tried this.syntax But this is always prompting a "Open / Save / cancel " dialog

monresponse.ContentType = "application/msword";
document.Save(wordfilename.ToString(), SaveFormat.Doc, SaveType.openInWord, monresponse);

Thanks
Venkat

Hello

Thanks for your request. As I can see you use some old version of Aspose.Words. Please try using the latest version of Aspose.Words (9.5.0). You can download this version from here:
https://releases.aspose.com/words/net
Please see the following links to learn how to send the document to the client browser:
https://reference.aspose.com/words/net/aspose.words/document/save/
https://reference.aspose.com/words/net/aspose.words/contentdisposition/
Also, there is not any difference between syntax for MS Word 2003 or 2007 or other.
Best regards,

Hi downloaded new version and got a license from you.
But this version is always throwing “Open/Save/Cancel” dialog when document.save method is called. with both inline and inword options.
This was not happening in older version. that i was using.
Also I am i now getting “Cannot be opened because there are problems with the contents” Error when i hit the open button. The error details says. “The file is corrupt and cannot be opened”
This was not hppening in older version too.
Also I am now not able to go back the older version. “I am now getting Coluld not load file or assembly aspose.word, version 9.5.0 , error”
Please help!!!

Dear Venkat,

Thank you for information.

To prevent error “Cannot be opened because there are problems with the contents” getting please use Reponse.end() after Save method calling (doc.Save(Response, “out.doc”, ContentDisposition.Inline, null);).

As per Open/Save/Cancel dialog - that is standard dialog when save method is called. There is a way to prevent its opening on a client site through ie setting https://forum.aspose.com/t/86985. But not for the server side.

Hi

Thanks for your request. Just to clarify a bit, the Save doc.Save(Response, “out.doc”, ContentDisposition.Inline, null); method works like the following code.

Aspose.Words.Document doc = new Aspose.Words.Document();
Aspose.Words.DocumentBuilder builder = new Aspose.Words.DocumentBuilder(doc);
builder.Write("Hello world!!!");
MemoryStream stream = new MemoryStream();
doc.Save(stream, SaveFormat.Doc);
Response.Clear();
// Specify the document type.
Response.ContentType = "application/word";
// Other options:
// Response.ContentType = "text/plain"
// Response.ContentType = "text/html"
// Specify how the document is sent to the browser.
// Response.AddHeader("content-disposition","attachment; filename=MyDocument.doc");
// Another option could be:
Response.AddHeader("content-disposition", "inline; filename=out.doc");
// Get data bytes from the stream and send it to the response.
byte[] bytes = stream.GetBuffer();
Response.BinaryWrite(bytes);
Response.End();

When you send file to client’s browser open/save/cancel dialog is always displayed.
Best regards.