How to Password-Protect Individual Word Mail Merge Documents
Question details
The user wants to generate individual files from a Word mail merge and assign a unique password to each resulting document.
- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Generating and distributing sensitive documents via mail merge that require individual file security and unique passwords for different recipients.
- Observed behavior
- Microsoft Word does not have a built-in feature to split mail merge outputs into individual files or assign unique passwords automatically based on merge fields.
Ensure your data source contains a dedicated column with the specific passwords you want to assign to each recipient, and create a backup of your main document before applying any VBA scripts.
Use a VBA Macro to Generate and Protect Individual Files
Create a custom VBA script to split the merged documents and dynamically apply a password from your data source to each file.
Since Microsoft Word lacks a native feature for assigning unique passwords during a mail merge, utilizing a VBA macro is the most reliable workaround. The script can pull data from a designated password column in your source file to encrypt each generated document individually.
To execute the code successfully, you will need to map your field names correctly in the script and save your working file in a macro-enabled format.
Open your main mail merge document and press Alt + F11 to launch the Visual Basic for Applications (VBA) Editor.
Click on Insert > Module in the top menu, then paste your custom mail merge macro code designed to split files and apply passwords.
Modify the VBA script's field names (such as First_Name, Last_Name, and Password) to perfectly match the column headers used in your Excel data source.
Go to File > Save As and change the file type to Word Macro-Enabled Document (.docm) to ensure the macro is preserved.
Close the VBA editor, return to your document, press Alt + F8, select your macro, and click Run to generate the password-protected files.
Use a Third-Party Add-in like MergeTools
If you are not comfortable writing or running VBA code, use a trusted third-party add-in to handle the split and encryption process.
Experience Seamless Document Creation with WPS Office
While advanced mail merge encryption requires custom scripts in Microsoft Word, WPS Office provides a robust, lightweight, and highly compatible environment for your daily document processing needs, including mail merge and robust document protection.
- 1. Download WPS Office: Visit the official WPS website to download and install the free WPS Office suite.
- 2. Open Your Document: Launch WPS Writer and open your existing Word document directly.
- 3. Manage Data Safely: Use the familiar interface to continue editing, merging, and applying document protections.

Frequently Asked Questions
Can I use Word's default restrict editing feature for mail merge?
No, the built-in 'Restrict Editing' or 'Encrypt with Password' features in Word apply to the entire active document. They cannot dynamically assign unique passwords to individual records during an active mail merge process.
Why did my mail merge output as a single document instead of individual files?
By default, finishing a mail merge in Word creates a single continuous document containing all the merged pages. To get individual files for each recipient, you must use a VBA macro or a dedicated add-in to split the output.
Do I need to save my data source in a specific format to use a password macro?
Your data source (such as an Excel spreadsheet) works normally, but it must include a clear, specific column containing the unique passwords you want to assign to each recipient. Ensure there are no blank rows or special characters in the column header.
Are VBA macros safe to run in my Word document?
Macros are safe if you write them yourself or obtain them from a highly trusted source. Because macros can execute code on your computer, Word disables them by default. You will need to enable macros in the Trust Center or save the file as a .docm to run the script.




