Free Support Forum - aspose.com

Exception thrown by aspose word

I am evaluating integrating the .total package into a product we are developing.

Although it appears to work well MOST of the time, the library throws an exception (Unsupported file format) when the .doc file in question is in fact pure ascii text. (Old .doc files could be saved as text but still have a .doc ending.)

The first file to hit the problem is attached.

Is there a way around this or do you have plans to read such files in future?
Rudi

Hi

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

Thanks for your inquiry. Please follow the link to learn how to load plain text documents:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/howto-load-plain-text-txt-files.html

Hope this helps.

Best regards.

I had read the docs - and understood that possibility.

My problem is that I am scraping thousands of files and when they have a .doc ending and aspose throws the exception I have to manually change the ending to .txt. Apparently a LOT of older files were saved by people using Word "save as text" option

BUT if there is no way for aspose to deal with .doc containing text only I guess I have no choice.

Thanks

Hi

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

Thanks for your inquiry. You can use Aspose.Words to determine format of the file without loading it:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/aspose.words.fileformatutil.detectfileformat_overloads.html

So you can know is format supported by Aspose.Words or not before loading the document. Also, I think the following article could be useful for you:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/howto-check-format-compatibility.html

Best regards.