Free Support Forum - aspose.com

Aspose.Words.UnsupportedFileFormatException

Hi,

I am using Aspose 5.0.1 for .Net .When creating DocOpen object for attached

file it gives an Exception That is "Aspose.Words.UnsupportedFileFormatException"

,but this file open successfully with word 2003.

Regards

Jai

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

Thank you for your inquiry.

This file is an HTML document in UTF-7 encoding without Byte-Order Mark (BOM). Aspose.Words cannot recognize it natively. As a workaround you can try the following code snippet:

string text = File.ReadAllText("Test.doc", Encoding.UTF7);

byte[] textBytes = Encoding.UTF8.GetBytes(text);

using (MemoryStream strm = new MemoryStream(textBytes))

{

Document doc = new Document(strm);

doc.Save(@"Test200\out.doc";

}

If you have many files and all in UTF-7 then it is appropriate for you. But if all files are different loading them all using the same universal code could be a complex task.

This issue is known in our defect database as #3955. We’ll notify you on any progress or when it is fixed.

Regards,

Thanks Viktor Sazhaev for your prompt respose and hopes that problem will be sorted out soon

Regards
Jai

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

I have good news for you. #3955 has been fixed in the current codebase. I loaded your file with last changes in the library. We need some negotiations with Aspose.Pdf Team and then we can release a hotfix. Please expect it in 1-2 weeks.

Regards,

Hi Viktor

still waiting for your reply.

Regards
Jai

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

Thanks for your inquiry. Hotfix will be released within 1-2 days. I will notify you.

Best regards.

The issues you have found earlier (filed as 3955) have been fixed in this update.