Free Support Forum -

Avoid File Corrupted & Null Reference Exceptions on Loading Opening MS Word DOC Document with Aspose.Words for .NET C#

I am trying to load the attached doc file with Aspose.Words .NET 21.2 but there is an exception with the message The document appears to be corrupted and cannot be loaded. while the file is opened successfully. Can you review the sample and give me advice?
var doc = new Document(@“sample.doc”);
catch (Exception e)
Console.WriteLine(“Done”); (44.5 KB)


You’re right; Aspose.Words for .NET currently throws following exception upon loading this particular Word DOC document that you shared:

Message=The document appears to be corrupted and cannot be loaded.
Inner Exception 1:
NullReferenceException: Object reference not set to an instance of an object.

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