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

Free Support Forum - aspose.com

Mail merge does not generate correct output when fields are inside textbox using .NET

A customer of ours uses text boxes in his template. After the mail merge, however, these are no longer positioned where they should be. The text boxes move from page 2 to page 1. Everything moves and overlaps.
If you do everything with MS Word, the text boxes and the text remain in the expected position.

Here is a sample program with the problem template:
20200609 - TextboxOverlap.zip (51.2 KB)

And here is the output comparison MS Word - Aspose.Word:
Output comparison.zip (110.8 KB)


We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-20582 . You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.


It is to inform you that the issue which you are facing is actually not a bug in Aspose.Words. So, we have closed this issue (WORDSNET-20582) as ‘Not a Bug’.

There is no problem with MEREGEFIELD s inside textboxes. Those are merged as expected. We have added new property in Aspose.Words i.e. MailMerge.RetainFirstSectionStart

You can set the value of this property to false as shown below to get the desired output.
document.MailMerge.RetainFirstSectionStart = false;

Pease note that this property will be available in the next version of Aspose.Words i.e. 20.7.

You may change first section start value to NewPage programmatically or manually to get the correct output. Please check the attached image for detail. section start.png (16.7 KB)

I have changed first section start value to NewPage. The result now appears to be the same as in MS Word.
When the new version of Aspose is available, I will also test the MailMerge.RetainFirstSectionStart property.


The next version of Aspose.Words 20.7 will be available at the start of next month (July 2020).