Free Support Forum -

Mail merge region for multiple rows

We'd like to use the MailMerge.ExecuteWithRegions method to repeat 2 rows in a table, without programmatically manipulating the table (since the template doc should be able to change).

The ideal would be to repeat 2 rows within the table itself. However, if the TableStart / TableEnd fields are not in the same row, we would get this error: "Mail merge region is badly formed. TableStart and TableEnd should be in the same section, soame table row or same table cell.". It would therefore be a nice feature to allow TableStart/TableEnd to be in different rows.

Taking another approach and placing TableStart and TableEnd around a small table containing 2 rows only, causes unwanted paragraph breaks between the tables (they should be flush against each other) since it seems to be impossible to position the TableStart/TableEnd fields to the immediate left/right of the table in Word itself.

We would appreciate any suggestions.


Thanks for your request. You can place TableStart and TableEnd fields outside the table.













But then you should programmatically remove empty paragraphs between tables after executing mail marge. See the following example.

Document doc = new Document(@"061_89177_HannesRSA\in.doc");


NodeCollection nodes = doc.GetChildNodes(NodeType.Paragraph, true);

ArrayList list = new ArrayList();

foreach (Node node in nodes)


Paragraph par = (node as Paragraph);

if (par.Range.Text == "\r")





foreach (Paragraph par in list)





I hope that it will help you.

Hi Vitaly,

Thanks, this should work for what we are doing.

This feature is now available in this .NET update and in this Java update. You can now avoid empty paragraphs in repeating regions in this version by setting RemoveEmptyParagraphs to true.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.