Skip to main content

How to create repeating rows in Word merge document

As with RTF merges, it is possible to define a section of the document which will repeat once for each record that is returned. In the case of Word documents, however, there can be more than one such

Updated over 2 weeks ago

As with RTF merges, it is possible to define a section of the document which will repeat once for each record that is returned. In the case of Word documents, however, there can be more than one such section in the document. Here is an example of such a document with fields and a repeating template set:

Word Document with repeating rows

To create such a section:

  • add a table with two rows. In the first row, include headers for the table. In the second row, define the updated region.

  • In the first column of the second row, create a merge field just as above, but name the field: “TableStart:DataSource”. This field marks the beginning of the section.

  • In the last column of the second row, create a merge field called “TableEnd:DataSource” to mark the end of the section.

  • After the first merge field and before the last field merge, add simple merge fields for each column header.

Click here for the sample file.

Sample repeating rows code with TableStart:DataSource

Thing to note:

  • You can't have multiple "TableStart:DataSource" and "TableEnd:DataSource" combination in one Word document. The below error message will appear:.

    Repeating Rows Error

Did this answer your question?