Convert from wordml to doc not working

Hi,

I an having a problem loading a file in wordml format and saving it as a word document using the aspose.words Document. The code below should load the document (attached as doc file.txt into the string finalOutput) and save it to a stream as a doc. The result is a word file that only has 1 page and it’s empty which is wrong.

MemoryStream docStream = new MemoryStream();
MemoryStream wordMLStream = new MemoryStream(Encoding.UTF8.GetBytes(finalOutput));
Document wordDocument = new Document(wordMLStream, null, LoadFormat.WordML, null);
wordDocument.Save(docStream, SaveFormat.Doc);

Regards
David

Hi

Thanks for your inquiry. The file you had attached is not a wordml document. So you can open this document using Aspose.Words.

Best regards.

Hi,

I realise it’s a text file but it is a valid wordML document as far as i know. Why do you think it isn’t a valid file?

Cheers

David

Hi

Thanks for your inquiry. Just try to open it using MS Word. WordML documents always starts from the following tags:

<?mso-application progid="Word.Document"?>

Your document starts with

<pkg:package xmlns:pkg="http://schemas.microsoft.com/office/2006/xmlPackage">

Best regards.

This document DOES load correctly into word 2007. It uses the Office 2006 schema. the package is part of the way word versions beyond 2003 deal with embedded images etc.

The file is saved with the Word XML option in word 2007 rather than the compatibility Word 2003 XML format.

Can we confirm therefore that ASPOSE is compatible only with the WordML formats as of 2003

Hi

Thanks for your inquiry. Yes, you are right. Aspose.Words supports 2003 schema. Please see the following link for more information.

Best regards.

Hi,

I am not able to access the url. Can you please paste correct URL?

Thanks.

Hi

Thanks for your request. The latest version of Aspose.Words supports both Word 2003 and Word 2007 schema. You can download the latest version of Aspose.Words from here:

Please see the following link for more information:

Best regards.