MailMerge With Regions - Page Break Not Working

I have a mailmerge template that works great in Java using code like this…

doc2.getMailMerge().executeWithRegions(allRiskData);
doc2.getMailMerge().setCleanupOptions(MailMergeCleanupOptions.REMOVE_UNUSED_FIELDS);

The template has one layer of nested regions and they are well formatted. I would like to have a page break inserted as the very last item before the final closing <TableEnd:myLastRegion> tag.

I get mixed results - and none of them are what I would expect. Sometimes I get a page break that separates each outer most region (which is good) - but the final output document has 3-4 blank lines at the top of each new page.

And then sometimes I will get a whole blank page in between the outer most regions.

Have you seen this before? Any help would be appreciated. I can provide my template if necessary.

Thanks

–John

Hi John,

Thanks for your inquiry. It would be great if you please share following detail for investigation purposes.


  • Please attach your input Word document.
  • Please

    create a standalone/runnable simple Java application that demonstrates the code (Aspose.Words code) you used to generate
    your output document

  • Please attach the output Word file that shows the undesired behavior.
  • Please
    attach your target Word document showing the desired behavior. You can
    use Microsoft Word to create your target Word document. I will
    investigate as to how you are expecting your final document be generated
    like.

Unfortunately,
it is difficult to say what the problem is without the Document(s) and
simplified application. We need your Document(s) and simple project to
reproduce the problem. As soon as you get these pieces of information to
us we’ll start our investigation into your issue.