Mail merge throws System.NullReferenceException when document has page field using C#

Hello,
our company is using a template for merging xml with a template that now fails with a System.NullReferenceException when the footer contains the following fields:
{MERGEFIELD TableStart:MergeData \* MERGEFORMAT}{MERGEFIELD Title}{MERGEFIELD TableStart:MergeData \* MERGEFORMAT} {PAGE \* MERGEFORMAT}{MERGEFIELD TableStart:MergeData \* MERGEFORMAT}{MERGEFIELD Title}{MERGEFIELD TableStart:MergeData \* MERGEFORMAT} {PAGE \* MERGEFORMAT}
That is, the footer contains one merge field for “Title” and one builtin field for “Page Number”. The merge succeeds when the Page Number field is removed, see attached samples for xml data and Word Templates that illustrates the problem. Look in the footer in the templates.
We are using Aspose.Words version 11.1, and this issue was not a problem when we used earlier releases.
thanks, Henrik (Developer at Genus)

Hi Henrik,

Thanks for your query. I have tested the scenario and have managed to reproduce the same problem at my end. I have logged this issue in our issue tracking system and you will be notified via this forum thread once this issue is resolved.

We apologies for your inconvenience.

Hello,
and thanks for quick response! This matter is highly critical for us as it was discovered in a large business solution and if possible we would like a fix for this issue as soon as you are able to.
In general, we find it hard to to track down problems in our customers’ Word templates as most errors only ends up as a general Access Violation of some kind. We would appriciate better and more specific exception messages from Aspose.Words (and of course from Aspose.Cells) to assist us in our debugging. Just to let you know!
thanks, Henrik

Hi Henrik,

This issue is pending for analysis. As soon as, the analysis is completed, we will update your about the fix of this issue.

Hello,
further investigation shows that the error has something to do with how the document is created.
The error occurs when the document has Header with “Different First Page” set. When this is changed so that we remove that option and uses a Section Break on Page 2 (leaving us with two different sections, one for Page 1 and one for Page 2), the merge works fine. See attached Template for how to reproduce.
This issue is critical for us as the templates are designed by end-users of our system and not by developers. Functionality in templates that worked with version 10.0.0.0 of Aspose.Words is broken when using 11.1.0.0 so at this time we have a critical error in our system until this issue is fixed.
thanks,
Henrik (Developer at Genus AS)

Hi
Thank you for additional information. I attached your document to the issue. We will let you know once the problem is resolved. At the moment the issue is pending for analysis. Once we have more information regarding it we will let you know.
Best regards,

The issues you have found earlier (filed as WORDSNET-6016) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.