Free Support Forum -

TXT file containing zeroes can't be opened


The attached TXT file contains zeroes instead of spaces.
Aspose.Words throws “Aspose.Words.UnsupportedFileFormatException: ‘Unknown file format: Unknown’”

I agree the file is not very correct, but applications like notepad, wordpad, MS Word can open (1020 Bytes)

Best Regards,


Please check if the following code is acceptable for you?

Aspose.Words.LoadOptions loadOptions = new Aspose.Words.LoadOptions();
loadOptions.LoadFormat = LoadFormat.Text;
Document doc = new Document("D:\\296191_Zeroes\\296191_Zeroes.txt", loadOptions);            

loadOptions.LoadFormat = LoadFormat.Text;

This line solves the problem. Thanks!
I’ve expected it will automatically recognize it as a text format.


For the sake of correction, we have also logged this problem in our issue tracking system. The ID of this issue is WORDSNET-17373. We will further look into the details of this problem and will keep you updated on the status of this issue. We apologize for any inconvenience.