Document Editing Problems

Add a Conditional Extra Row to a Word Many-to-One Mail Merge

Aamir Naveed AkramAamir Naveed Akram Nov 20, 2026 869 views

Question details

Add a second table row for a child record only when an additional field contains data in a many-to-one Word merge.

Add a Conditional Extra Row to a Word Many-to-One Mail Merge
Product
Microsoft Word with Graham Mayor's Many-to-One merge add-in
Device & OS
not provided
Scenario
A many-to-one mail merge groups child records in a table, with an optional field that may require an extra row.
Observed behavior
The add-in creates one table row per child record and does not create a second row for the same record based on an IF-THEN condition.
Before you start

Identify the data source column that determines whether an extra row is needed and decide which values that row should contain. Include test records with both populated and empty values in that column.

Solution 1Recommended

Use a custom macro to add conditional rows

Use a customized Word macro when you can adapt the merge process or post-process its output.

The add-in does not create a second row for a record through an IF-THEN rule. A custom macro must identify each record and its optional field value, then add a row only when that value is populated.

1
Plan the record mapping

Open the data source and the Word merge document. Identify a unique record identifier, the optional field, and where the extra row should appear.

2
Make the values available

Include the identifier and optional field in the merged output, or arrange for the macro to read them from the data source. The macro needs a reliable way to match each value to its existing table row.

3
Create or obtain a macro

In Word, open Developer > Visual Basic and create a macro tailored to the document and data source, or ask a VBA developer to create one. Have it insert a table row after the matching record only when the optional field is not empty.

4
Test the result

Run the merge and macro on the test records, then inspect the output table to confirm that populated fields produce extra rows and empty fields do not.

Customization is required: The macro depends on the data source and document layout; an ordinary Word IF field alone does not make the add-in generate a second row.
Free Microsoft Office alternative

Edit Word Merge Documents with WPS Writer

WPS Office is a free, lightweight alternative for editing Word documents in a familiar interface. Its Microsoft Office format compatibility helps you move documents between applications, though it does not fix the Word add-in's conditional-row limitation.

Review and edit tables in merged documentsOpen and save Microsoft Word DOCX filesWork in a familiar, easy-to-use interfaceMove existing Office documents to a lightweight suite
microsoft office alternative - wps office

Frequently Asked Questions

Can an IF-THEN field make the add-in insert a second table row?

No. Graham Mayor's Many-to-One merge add-in uses one table row per child record and does not create another row for the same record through an IF-THEN rule.

What information does a macro need to add the right row?

It needs a way to match each existing table row to its source record, the optional field's value, and the content to place in the new row. A unique record identifier can help establish that match.

How can I test whether the conditional rows work?

Run the merge on a small data set containing both populated and empty optional fields. Check the resulting table to make sure only the populated records receive extra rows.

Where can I ask about customizing Graham Mayor's add-in?

Use the contact page on Graham Mayor's website and provide a sample document, sample data, and an example of the desired table layout.