RemoveEmptyParagraphs Error


I get the following error from the Aspose Word component when I perform a merge:

System.NullReferenceException: Object reference not set to an instance of an object.
at v.c(ck A_0, Object A_1)
at v.a(aw A_0, ca A_1)
at v.a(ca A_0)
at Aspose.Word.MailMerge.b(ca A_0)
at Aspose.Word.MailMerge.Execute(DataTable table)
at …

The error only occurs when both:
a) a field being merged is empty;
b) the empty field is one of many on the same line in the Word template, and;
c) the RemoveEmptyParagraphs property is set to true.

I have emailed (to you a sample application, database, and word template so you can recreate this error.



I’ve fixed this and it will come out in the next hotfix soon. Now the paragraph is only removed when it really becomes empty, not when one of the fields becomes empty.


Aspose.Word 1.6.1 with a fix is available.