MailMerge: Repeating Document Section Instead Of Whole document


#1

When merging with a dataset in vb.net , when there is more then one row mailmerge currently repeats the whole document. Is there any way of making it repeat with in the document instead of repeating the whole document? I would like it so it repeats in the document and then start a new page if neccessary?


#2

Hi,

Thank you for considering Aspose.

Sure, you just need to use mail merge with regions instead of simple mail merge. Basically, that means you define merge regions in your template that will be repeated accordingly to the data source records rather than repeating the whole document. To know more about mail merge with regions, please refer to the Aspose.Word Programmers Guide located here:

http://www.aspose.com/Wiki/default.aspx/Aspose.Word/Home_Page.html

You will find necessary information in the Performing Mail Merge section.


#3

Hi thanks for the quick reply, I have mail merge regions working now but I have another question…

Is it possible to use the document builder to dynamically build a table in a document where I am performing a mail merge. As I understand mail merge region only works in single table cells as opposed to repeating rows and building a dynamic table.

Help anyone??

Thanks Mike


#4

Sorry I don’t seem to fully understand what doesn’t suit you and what you want to achieve. You can certainly use document builder inside a mail merge handler and build everything you want when a merge field is encountered, but why do you need to dynamically build a table? Mail merge with regions repeats anything enclosed between the TableStart and TableEnd marks, and if you properly place them into a table row (they must be inside the same row), the table will dynamically grow. Please elaborate your question.