Aspose Words Java- executeWithRegions() not working

I’m trying to use Aspose Words for Java. I have a docx document with merge fields, and regions.
I’ve implemented IMailMergeDataSource and am trying to use executeWithRegions, with that implementation. None of the methods of my class seem to be called and I see no fields replaced in the resulting pdf.
When I pass the same object to execute() my data is picked up, but obviously nothing is done with my “StartTable:” markers…

Thanks for your request. Could you please attach your template here for testing? I will check the issue and provide you more information.
Best regards,

I think I have found my problem. I did not have a TableStart at the very start of the document, nor the matching TableEnd (I have nested regions).

But now I’ve added these and I get an Exception about the fact that the region spans multiple sections. The document indeed has two sections which the outer region spans (I needed different margins). Is there a way around the need for there to be only one section in a region?

As a work-around I removed my section break. But now I get an exception…

java.lang.IllegalArgumentException: position
at 323)
at com.aspose.words.fg.a( 254)
at com.aspose.words.fg.a( 30)
at com.aspose.words.vp.a( 44)
at com.aspose.words.Document.updatePageLayout( 1416)
at 1349)
at com.aspose.words.Document.AR( 1362)
at com.aspose.words.Field.Gk( 455)
at com.aspose.words.Field.a( 390)
at com.aspose.words.oo.a( 154)
at com.aspose.words.oo.l( 107)
at com.aspose.words.ol.execute( 82)
at 97)
at com.aspose.words.oo.Jr( 84)
at com.aspose.words.yj.UL( 240)
at com.aspose.words.yj.a( 71)
at com.aspose.words.MailMerge.executeWithRegions( 330)
at nl.hsac.aspose.OpenDocx.main( 47)

Thank you for additional information. Could you please also provide a code that will allow us to reproduce the problem? We will check the issue and provide you more information.
Best regards,

Since I created a separate thread for the exception I think we should not go into more information about that here.

On the question in my earlier post: are there any plans to support regions that span multiple sections in Word?

Thanks for your request. No, currently we do not have any plans to support section break within regions. This can cause a lot of problems. I think this will make more harm than good.
Best regards,