How to Require Word Fields to Be Completed Before Saving
Question details
The user wants to prevent a Microsoft Word document from being saved if specific required form fields, drop-down lists, or content controls are left empty.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Creating standardized forms or templates where users must provide mandatory information before they are allowed to save, print, or close the file.
- Observed behavior
- Microsoft Word does not provide a built-in toggle or setting to enforce mandatory fields, allowing users to save incomplete documents unless complex VBA macros are utilized.
Since enforcing mandatory fields requires writing custom VBA code, ensure that your document is saved as a Macro-Enabled Document (.docm) and that you have enabled the Developer tab in your Word ribbon.
Use VBA Macro (DocumentBeforeSave) to Validate Fields
Implement a VBA macro that intercepts the save action and checks the status of required fields, canceling the save if any information is missing.
Microsoft Word requires Visual Basic for Applications (VBA) to enforce field completion. By using the 'DocumentBeforeSave' event, you can intercept the native save command, check whether specific content controls contain data, and alert the user to fill in missing information before the document is allowed to save.
To ensure the macro runs smoothly without triggering constant security warnings for users filling out the form, it is highly recommended to store the approved macro-enabled template in a Trusted Location as configured by your Office security policies.
Navigate to File > Options > Customize Ribbon. In the right-hand column under Main Tabs, check the box next to 'Developer' and click OK.
Click the newly added Developer tab on the ribbon and select 'Visual Basic' (or press Alt + F11) to launch the VBA Editor window.
In the Project Explorer pane on the left, double-click 'ThisDocument' for your specific file. Set the left dropdown at the top of the code window to 'Document' and the right dropdown to 'DocumentBeforeSave'.
Within the DocumentBeforeSave subroutine, write logic to check the .ShowingPlaceholderText property of your required Content Controls. If a required control is empty, display a MsgBox alerting the user and set 'Cancel = True' to block the save.
Close the VBA editor and go to File > Save As. Change the file format to 'Word Macro-Enabled Document (*.docm)' and save your file.

Looking for a Lightweight and Highly Compatible Word Processor?
Dealing with complex macro security policies and lack of native form validation in Microsoft Word can be frustrating. Try WPS Office, a highly compatible, free, and lightweight alternative that handles standard Word documents seamlessly.
- 1. Download WPS Office: Visit the official WPS Office website and click the free download button for your operating system.
- 2. Install the Software: Run the downloaded installer file and follow the quick on-screen instructions to set up the software.
- 3. Open Your Documents: Launch WPS Writer and simply drag and drop your existing Microsoft Word documents to continue working without losing formatting.

Frequently Asked Questions
Can I require fields to be completed without using macros in Word?
No, Microsoft Word does not have a native setting or built-in feature to enforce mandatory fields. Using VBA macros is the only supported way to prevent saving when specific form fields or content controls are empty.
Would converting the Word document to a PDF solve the mandatory field issue?
While PDF forms visually support mandatory fields, strictly preventing a user from saving or submitting a PDF also requires custom JavaScript programming. This introduces similar security and configuration concerns to Word macros.
Why does my macro-enabled document show a security warning when opened?
Office applications block macros by default to protect your system from potentially malicious code. To stop this warning, the macro-enabled document must be stored in a designated 'Trusted Location' as defined by your Office security policy settings.
What events can I use to prevent a user from bypassing required fields?
In addition to intercepting the save command with the 'DocumentBeforeSave' event, you can use 'DocumentBeforePrint' and 'DocumentBeforeClose' in VBA to ensure the user cannot print the form or close the application without providing the mandatory information.




