How to use regions in mail merge/smart marker in ms word template?

Thanks, Yes, this example is working.
But what was the issue in my application?

And do you provide any sample for custom data source example having both non region data and region data.

@Rakesh_M When you use the same data source to execute mail merge twice, you should reset position of record in data source. After executing mail merge first time moveNext method returns false. So when you try to execute mail merge second time using the same data source without resetting position, the data source is considered as empty.

im not getting the proper output.
i need the the output like this below specified for the above application.
Could you please suggest, what are the changes need to do in my code.
need code changes helps me.


  • docName1
  • docName2

Can i use for 2 methods for this requirement? (13.8 KB)

@Rakesh_M To get the expected output your should use two data source.
The first one for Account, address1 and cName, which will be used with MailMerge.execute method and fill fields outside the region.
The second data source for documents list, which is used for filling region with data and is used with MailMerge.executeWithRegions method.

ok, thanks. I’ll try.

1 Like