Document Editing Problems

How to Group Variable-Length Records in Word Mail Merge

Natalie TaylorNatalie Taylor Oct 26, 2026 868 views

Question details

The user needs to perform a mail merge that groups a variable number of subscription records per dealer, ensuring each dealer's records start on a new page.

How to Use Word Mail Merge for Variable-Length Groups on One Page
Product
Microsoft Word
Device & OS
not provided
Scenario
Creating a mail merge document where multiple related records must be grouped under a single entity (like a dealer) without breaking tables or creating static fixed-length structures.
Observed behavior
A standard mail merge creates one page per record rather than grouping variable amounts of related records on a single page per dealer.
Before you start

Ensure your data source, such as an Excel spreadsheet, is sorted by the grouping field (like the dealer name or ID) before initiating the mail merge.

Solution 1Recommended

Use Directory Mail Merge with Next If Fields

This native Word method allows you to group multiple records onto a single page conditionally.

By changing your document type to a Directory, Word will list records consecutively rather than forcing a page break after each row. You will need to use IF fields to control formatting when the dealer changes.

1
Change Document Type

Open your Word document, go to the Mailings tab, click Start Mail Merge, and select Directory (or Catalogue in older versions).

2
Insert Merge Fields

Insert the merge fields for the dealer and subscription data into your document where you want them to appear.

3
Add Conditional Rules

Click Rules in the Mailings tab and select Next Record If. Configure the rule to compare the current dealer name with the next record so Word knows when to group them.

4
Insert Page Breaks

To ensure each dealer begins on a new page, press Ctrl+F9 to create a field code and write an IF statement that inserts a page break whenever the dealer name changes.

Use Directory Mail Merge with Next If Fields
Complex Field Coding Required: Setting up Directory merges with conditional page breaks requires exact syntax in Word field codes (using Ctrl+F9). Consider searching for Microsoft's official Mailmerge tutorial for exact code snippets.

Group Mail Merge Records Easily in WPS Office

WPS Office provides a highly compatible and intuitive Mail Merge feature. You can seamlessly connect spreadsheets to group multiple records, format tables, and export grouped documents with minimal effort.

  1. 1. Prepare Data in WPS Spreadsheet: Open WPS Spreadsheet and sort your subscription data by the dealer column to ensure groups are ordered correctly.
  2. 2. Start Mail Merge in WPS Writer: Open WPS Writer, navigate to the Mailings tab, and click Mail Merge.
  3. 3. Connect Data Source: Click Open Data Source and select your prepared spreadsheet.
  4. 4. Insert Fields and Rules: Use Insert Merge Field to place your data into the document. Utilize Next Record rules to manage grouping multiple items per page effectively.
Fully compatible with Microsoft Word (.docx) and Excel (.xlsx) formatsIntuitive Mailings tab interface for managing data sources and merge rulesLightweight application with robust document editing and table formatting capabilitiesFree alternative with familiar tools for complex document generation
microsoft office alternative - wps office

Frequently Asked Questions

Why does a standard mail merge create a new page for every single record?

Standard mail merges, like 'Letters', are designed to produce a separate document or page for each row in your data source. To group multiple rows on one page, you must use a 'Directory' (or 'Catalogue') merge type or insert specific Next Record field rules.

How do I force a page break when the dealer changes in a Directory merge?

You can nest an IF field inside your document that compares the current dealer merge field with the previous one. If they differ, the field condition is met and it triggers a manual page break.

Can I use a standard Word table to group records automatically?

Word does not automatically expand a single standard table to fit variable records in a basic mail merge. You must use a DATABASE field pointing to your Excel file to dynamically generate a table of variable length for each group.