Free Support Forum -

Convert from wordml to doc not working


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);


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

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.


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?



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

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

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

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

<w:wordDocument xmlns:w="" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:sl="" xmlns:aml="" xmlns:wx="" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" w:macrosPresent="no" w:embeddedObjPresent="no" w:ocxPresent="no" xml:space="preserve">

Your document starts with

<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<pkg:package xmlns:pkg="">

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<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

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

Best regards.


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



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

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.