How to Grey Out Irrelevant Sections in a Protected Word Form
Question details
The user needs to visually grey out or disable specific questions and text fields in a protected Word form based on the answer selected in an earlier checkbox.

- Product
- Word
- Device & OS
- not provided
- Scenario
- Creating dynamic and conditional document forms where secondary fields react to user input.
- Observed behavior
- Legacy form fields have limited conditional behavior and do not automatically hide or disable unrelated controls without custom scripting.
Before beginning, ensure your document is saved as a Macro-Enabled Document (.docm) and that you have enabled the Developer tab in your ribbon to access VBA and form controls.
Use VBA Macros to Control Form Field Visibility
Writing a Visual Basic for Applications (VBA) macro is the standard method to detect a checkbox state and dynamically disable or grey out other form fields.
Standard content controls and legacy form fields in Word do not natively support conditional logic (like hiding fields based on previous answers). To achieve this, you must use a VBA macro that triggers an action when the user interacts with the form field.
Navigate to File > Options > Customize Ribbon. In the right pane, check the box next to 'Developer' and click OK to add the Developer tab to your Word ribbon.
Go to the Developer tab. Use the 'Legacy Tools' icon to insert a Checkbox Form Field for the initial question, and Text Form Fields for the dependent sections you want to dynamically grey out. Double-click each field to set unique bookmark names.
Press Alt + F11 to open the VBA Editor. Insert a new module and write a macro that checks the value of the checkbox bookmark. If the checkbox is selected, program the macro to change the target text fields' Font.ColorIndex to grey and set their Enabled property to False.
Return to your document, double-click the Checkbox Form Field, and under the 'Run macro on' section, select your newly created macro from the 'Exit' dropdown menu. This ensures the script runs when the user tabs out of the checkbox.
On the Developer tab, click 'Restrict Editing'. Check 'Allow only this type of editing in the document', select 'Filling in forms' from the dropdown, and click 'Yes, Start Enforcing Protection'. Test the document to ensure the conditional greying out works as expected.

Use WPS Writer to Build Professional Document Forms
WPS Office provides robust developer tools for creating and protecting interactive document forms. Enjoy full compatibility with Microsoft Word formats while easily managing text fields, checkboxes, and document protection settings.
- 1. Enable Developer Tools: Open WPS Writer, go to Menu > Options > Customize Ribbon, and enable the Developer tab to access advanced form controls.
- 2. Add Form Fields: Navigate to the Developer tab and use the Forms group to insert Checkboxes, Drop-Down lists, and Text Fields directly into your document layout.
- 3. Restrict Editing: Click 'Protect Document' to lock the layout, ensuring that respondents can only interact with and fill in the designated form fields.
- 4. Save and Share: Save the file in standard .docx or .docm formats to securely share the interactive form with colleagues or clients.

Frequently Asked Questions
Can I conditionally hide form text without using VBA macros?
Natively, Word does not support the conditional hiding of text or form fields based on other field values. You must use VBA macros or rely on a third-party specialized form builder software.
Why isn't my form updating immediately after I click the checkbox?
Checkbox macros typically run on the 'Exit' event. This means the user must click outside the checkbox or press the 'Tab' key to move to the next field for the conditional formatting macro to trigger.
Will my conditional form work if I send it to someone else?
Yes, provided you save the file as a Macro-Enabled Document (.docm) and the recipient's software allows macros to run. They will likely need to click 'Enable Content' when opening the file.




