logo
search
Office Settings & Configuration

How to Fix Word Mail Merge Filters Resetting Automatically

Maira MehtabMaira Mehtab Sep 22, 2026 868 views

Question details

Users experience an issue in Microsoft Word where mail merge filters connected to a SQL Server database automatically lose their saved criteria, particularly when a specific field like 'Type' is included in the query.

Product
Microsoft Word
Device & OS
not provided
Scenario
Filtering recipient lists during a mail merge operation connected to a SQL Server database.
Observed behavior
The filter dialog loses its saved criteria and resets, causing synchronization loss with the underlying SQL query, especially if the Edit Recipient List dialog is opened.
Before you start

Verify your current Microsoft Word version by navigating to File > Account > Product Information, as this bug behavior is often tied to specific application builds.

Solution 1Recommended

Apply a VBA Macro Workaround to Set the Query String

Use a VBA macro to manually capture filter values and apply them directly to the data source, bypassing the unstable filter dialog.

Because adding certain fields like the 'Type' field causes the Word filter dialog to lose synchronization with the underlying SQL query, you can bypass the standard user interface using VBA. This macro will programmatically enforce the query criteria directly to the document's mail merge data source.

1
Open the VBA Editor

Press Alt + F11 in Word to launch the Visual Basic for Applications (VBA) editor.

2
Create a Custom Input Form

Design a custom VBA user form to prompt for and collect your required filter parameters, such as the start, end, and type values.

3
Update the Query String

Write a script that takes the inputted values and updates the document's MailMerge.DataSource.QueryString directly to execute the desired SQL filter.

4
Execute the Mail Merge

Run your macro to apply the query and complete your mail merge process without relying on the built-in Microsoft Word filter dialog.

Workaround Limitation: Avoid opening the built-in 'Edit Recipient List' menu after running your macro, as confirming that dialog will clear your custom filter criteria again.
Free Microsoft Office alternative

Experience Flawless Document Operations with WPS Office

Tired of troubleshooting macro errors and mail merge synchronization bugs in Microsoft Word? WPS Office provides a lightweight, highly compatible alternative with an intuitive and stable Mail Merge feature. It natively supports Microsoft Office formats and easily manages complex data sources without the hassle.

  1. 1. Download WPS Office: Visit the official WPS Office website and download the free installation package.
  2. 2. Install the Suite: Run the downloaded installer and follow the quick on-screen instructions to set up the software.
  3. 3. Open Your Documents: Launch WPS Writer and directly open your existing Word documents and data sources to continue working smoothly.
Stable and intuitive Mail Merge functionality for seamless generation of letters and labels.Highly compatible with Microsoft Office formats including .docx, .doc, and .xlsx.Free, lightweight, and fast-loading on Windows, Mac, and Linux.Familiar user interface requiring zero learning curve for seamless migration.
microsoft office alternative - wps office

Frequently Asked Questions

Why does the Word Mail Merge filter dialog clear my criteria automatically?

This happens due to a known synchronization issue in Microsoft Word when handling SQL Server queries. Including specific fields, such as the 'Type' field, in your filter causes the dialog UI to lose synchronization with the underlying database query.

Can I prevent the 'Edit Recipient List' dialog from resetting my VBA query string?

Unfortunately, opening and confirming the built-in 'Edit Recipient List' dialog forces Word to refresh its interface, which overwrites and clears the custom MailMerge.DataSource.QueryString you set via VBA. The only prevention is to avoid opening the dialog after running the macro.

Where do I find my current Microsoft Word version to report this bug?

Open Microsoft Word, click on 'File' in the top ribbon, select 'Account', and look under the 'Product Information' section to find your exact build and version number.

Does WPS Office include a Mail Merge feature?

Yes, WPS Writer includes a fully-featured Mail Merge tool that allows you to easily connect spreadsheets or databases to your documents to generate mass letters, envelopes, and labels.