How to Create Dependent Checkboxes to Show or Hide Tables in Word Forms
Question details
The user wants to configure a Word form where selecting a content-control checkbox dynamically displays or hides specific related editable tables.

- Product
- Word
- Device & OS
- not provided
- Scenario
- Creating dynamic, interactive forms where specific sections or tables only appear when their corresponding checkbox is checked, keeping the document clean for saving or printing.
- Observed behavior
- Tables remain completely hidden until the user selects the linked content-control checkbox, which triggers the table to appear dynamically.
Ensure the Developer tab is enabled in your Word ribbon and verify that you have a basic understanding of VBA, as this solution requires using macros to detect checkbox changes.
Use VBA Macros and Content Controls to Toggle Table Visibility
Create a macro-enabled template and utilize the Document_ContentControlOnExit event to automatically change the hidden-text attribute of your tables when checkboxes are clicked.
By default, standard Word checkboxes do not automatically show or hide text. To achieve dynamic visibility, you must use Content Control Checkboxes linked to a VBA macro. The macro listens for when a user interacts with the checkbox and subsequently toggles the 'Hidden' font formatting of the target table.
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 ribbon.
Go to the Developer tab and click the 'Check Box Content Control' icon to insert your checkboxes. Click 'Properties' in the Developer tab, give each checkbox a unique 'Title' and 'Tag', and check 'Use a style to format text typed into the empty control'.
Insert the tables you want to link below the checkboxes. Select the entire table, press Ctrl+D to open the Font dialog, check the 'Hidden' box, and click OK so the table is hidden by default.
Press Alt+F11 to open the VBA Editor. In the Project Explorer, double-click 'ThisDocument'. Select 'Document' from the left dropdown and 'ContentControlOnExit' from the right dropdown. Write a VBA script that checks the ContentControl.Title and toggles the .Font.Hidden property of the specific table's range based on the checkbox's state.
Save your document as a Macro-Enabled Word Template (*.dotm) or Document (*.docm). Close the VBA editor, click your checkboxes, and verify in Print Preview that the tables hide or display as intended.

Easily Build Macro-Enabled Forms with WPS Writer
WPS Writer offers full support for developer tools, content controls, and VBA macros, allowing you to easily construct professional, dynamic forms that respond to user input without needing expensive software.
- 1. Download and Open WPS Writer: Launch WPS Office and create a new document in WPS Writer.
- 2. Access the Developer Tools: Go to Menu > Options > Customize Ribbon and enable the 'Developer' tab to access form controls.
- 3. Insert Controls and Macros: Use the Developer tab to insert Checkbox Form Fields and open the VBA Editor to write your dynamic visibility scripts.

Frequently Asked Questions
Why are my hidden tables still showing up when I print the form?
Word has a setting that allows printing of hidden text. To fix this, go to File > Options > Display, and ensure that 'Print hidden text' is unchecked before printing your form.
Do end-users need to enable macros to use this dynamic form?
Yes. Because the show/hide functionality relies on the Document_ContentControlOnExit VBA event, anyone filling out the form must enable macros when they open the document for the tables to appear.
Can I use legacy form fields instead of content controls for this?
Yes, you can use legacy checkbox form fields. However, instead of the ContentControlOnExit event, you would assign an 'On Exit' macro directly in the legacy checkbox's properties window to trigger the table visibility code.




