We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Mail Merge using DOCX


I am using Aspose.Word to generate a merged Word document and have used the sample code and files, which work great. However, I keep getting an error when trying to merge using an DOCX file. I am using the same Word template, constructed as a DOCX from scratch using the same data. The error is :

Aspose.Words.FileCorruptedException: The document appears to be corrupted and cannot be loaded. —> System.NullReferenceException: Object reference not set to an instance of an object.
at xda075892eccab2ad.xc1b08afa36bf580c.xa9aaee2edd3cd025(String x971e83bc97861294, Byte[] xf9a0d04800d70471, Int32 x10aaa7cdfa38f254)
at x79490184cecf12a1.xc37fee571c29ba92.xdafccb198ba91439()
at x79490184cecf12a1.xc37fee571c29ba92.x2506b757d67702ec()
at x79490184cecf12a1.xc37fee571c29ba92.x902b6f807c71becd(x3dabda6865ed239d x8ad4cdceb54e447f)
at x79490184cecf12a1.xc37fee571c29ba92.xd4c5b858945b0ab2(x3dabda6865ed239d x8ad4cdceb54e447f)
at x79490184cecf12a1.xc37fee571c29ba92.x06b0e25aa6ad68a9(xa52ef41af20225f0 xe134235b3526fa75)
at x79490184cecf12a1.xa52ef41af20225f0.DoRead()
at x79490184cecf12a1.x11e1346c12ead315.x06b0e25aa6ad68a9()
at x79490184cecf12a1.xae13d15563a3a703.x748a2047fcb706ad()
at x79490184cecf12a1.xae13d15563a3a703.x06b0e25aa6ad68a9()
at Aspose.Words.Document.x5d4db34d48fb3129(Stream xcf18e5243f8d5fd3, LoadOptions x27aceb70372bde46)

I have attached the Word document for your examination.

Johnny Moreno

Hi Johnny,

Thanks for your inquiry. After an initial test with Aspose.Words for .NET 15.10.0, we were unable to reproduce this exception on our end. We would suggest you please upgrade to the latest version of Aspose.Words. You can download it from the following link. Hope, this helps.

Download Aspose.Words for .NET 15.10.0

Best regards,