Automatically Add Word Comments When Checkbox is Selected
Question details
The user needs to generate a text comment or summary automatically within a Word inspection checklist based on whether a content-control checkbox is selected, left blank, or set to No.

- Product
- Word
- Device & OS
- not provided
- Scenario
- Creating an interactive inspection checklist or form where checking a box dynamically updates an adjacent text field or comment area.
- Observed behavior
- Requires a scripted method to detect the checkbox state (checked/unchecked) and output the corresponding text summary automatically.
Ensure the Developer tab is enabled in your Word processor's ribbon, as you will need to insert content controls and write Visual Basic for Applications (VBA) code.
Use VBA ContentControlOnExit Event to Generate Summaries
Write a VBA macro that detects when a user interacts with a content-control checkbox and automatically updates a designated text field based on its state.
To automate text generation based on a checkbox state, you need to use Visual Basic for Applications (VBA). Specifically, the 'Document_ContentControlOnExit' event allows Word to monitor when a user interacts with and leaves a content control checkbox.
Navigate to File > Options > Customize Ribbon and check the Developer box. Then, click the Developer tab on the ribbon, and insert a Check Box Content Control and a Plain Text Content Control from the Controls group into your document.
Select your newly inserted checkbox, click Properties in the Developer tab, and set both the Title and Tag fields to 'Check1'. Repeat this for the plain text control, naming its Tag 'Summary1'.
Press ALT + F11 to open the VBA Editor. In the left panel, double-click 'ThisDocument'. Paste a VBA script that triggers on 'Document_ContentControlOnExit', checking if 'ContentControl.Tag = "Check1"'. Use an If statement to update the 'Summary1' range text based on whether 'ContentControl.Checked' is True or False.
Go to File > Save As and choose 'Word Macro-Enabled Document (*.docm)' from the format dropdown. If you save it as a standard DOCX file, your macro code will be permanently deleted.

Create Professional Forms and Checklists with WPS Office
If managing complex VBA macros and developer settings in Microsoft Word is becoming cumbersome, try WPS Office. It provides a highly intuitive interface for document creation, perfect for standard forms and checklists.
- 1. Download WPS Office: Visit the official WPS website and download the free WPS Office suite for your operating system.
- 2. Open Your Document: Launch WPS Writer and open your existing Word forms or checklists to ensure perfect layout compatibility.
- 3. Insert Form Fields: Navigate to the Insert tab to easily add interactive elements like checkboxes to your documents.

Frequently Asked Questions
Why isn't my VBA macro triggering when I click the checkbox?
The 'ContentControlOnExit' event only fires when your text cursor exits the content control. After clicking the checkbox, you must click somewhere else in the document or press the Tab key to trigger the macro and generate the summary.
Can I use Legacy Form Field checkboxes instead of Content Controls?
Yes. If you use Legacy Form Fields from the Developer tab, you can double-click the checkbox to open its properties, check the 'Calculate on exit' option, and select your specific macro from the 'Run macro on exit' dropdown menu.
Will my automatic comments work if I send the document to someone else?
It will only work if the recipient opens the document in a desktop version of Word that supports VBA macros, and they must click 'Enable Content' when the security warning prompts them to allow macros to run.




