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

Free Support Forum - aspose.com

Aspose.Words Save using OpenInBrowser doesn't work with docx files

I have a web page where I create a document and open it in the browser. I have tested with both .doc and .docx files as I would prefer to move to the new format. The following code (using .docx) opens up word, but no document. If I change the code to use .doc everything works fine.

string strOutputFileName = "Test.docx";

Document oWordDoc = new Document();

DocumentBuilder oWordBuilder = new DocumentBuilder(oWordDoc);

oWordBuilder.ParagraphFormat.Alignment = ParagraphAlignment.Center;

oWordBuilder.Font.Bold = true;

oWordBuilder.Font.Name = "Tahoma";

oWordBuilder.Font.Size = 14;

oWordBuilder.Font.Underline = Underline.Single;

oWordBuilder.Writeln("Title");

oWordDoc.Save(strOutputFileName, SaveFormat.Docx, SaveType.OpenInBrowser, Response);

Hello

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

Thanks for your request. You should just add Response.End(); after sending document to the client browser.

Hope this helps.

Best regards,

That did the trick. Thanks.