How to Name PDF Mail Merge Files from an Excel Field
Question details
The user wants to assign specific names to individual PDF files generated via mail merge by pulling data from an Excel field (such as a facility name), rather than having them saved with default sequence numbers.

- Product
- Microsoft Word, Microsoft Excel, PDF
- Device & OS
- not provided
- Scenario
- Generating individualized PDF documents from a combined mail merge process.
- Observed behavior
- Standard PDF output saves the merged documents with generic names or automatic sequence numbers instead of utilizing descriptive fields from the connected data source.
Ensure the Excel column you plan to use for file naming does not contain any characters that are restricted in Windows or macOS file names, such as slashes (/ \), colons (:), asterisks (*), or question marks (?).
Use a Mail Merge PDF Automation Add-in
Since native mail merge does not support dynamic PDF naming out of the box, using a dedicated add-in or PDF automation tool is the easiest way to link file names to data fields.
Third-party mail merge extensions integrate directly into your word processor and allow you to configure the output settings to read specific columns from your linked database.
Download and install a document automation add-in (such as Adobe Acrobat PDFMaker or specialized merge tools) that supports PDF splitting and dynamic file naming.
Navigate to the 'Mailings' tab, click 'Select Recipients', and link your properly formatted Excel data source as you normally would.
Open the add-in's specific export settings from the Ribbon. Look for the 'File Naming', 'Save As', or 'Split Configuration' section.
Choose the variable or specific Excel column (e.g., 'Facility Name') from the dropdown menu to be used as the dynamic file name for each PDF.
Run the export process through the add-in interface to automatically generate and save individually named PDF files to your designated output folder.

Use a VBA Macro to Automate Dynamic Naming
Advanced users can bypass third-party software by writing a custom VBA macro to iterate through mail merge records and save them individually as PDFs.
Enhance Your Document Workflow with WPS Office
If you are frustrated by the limitations of standard word processors when handling PDFs and mail merges, WPS Office offers a powerful, lightweight alternative. With seamless spreadsheet processing and a built-in PDF editing toolkit, managing large volumes of files is easier than ever.

Frequently Asked Questions
Can I natively name mail merge PDFs dynamically in Word without add-ins?
No, standard mail merge functionality does not support dynamic file naming for individual PDF exports out of the box. You will need to rely on a VBA macro script or a third-party document automation add-in.
How do I ensure my Excel data works for file naming?
You must remove any characters from your Excel data that are illegal in computer file paths. Use the 'Find & Select' > 'Replace' tool in Excel to remove characters like /, \, :, *, ?, ", <, >, and | before starting the mail merge.
What happens if two records have the exact same name in the Excel field?
Depending on the tool or script you are using, the second file might overwrite the first, or the system might produce an error. It is best practice to combine fields (e.g., Facility Name + ID Number) to ensure every generated PDF has a uniquely identifiable file name.




