Fix Word VBA ContentControlOnExit Event Stopped Working
Question details
A Word VBA document's ContentControlOnExit event stopped hiding and showing templates after functioning properly for over a year.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Using a Word document equipped with drop-down menus, bookmarks, and a VBA event to automatically show or hide specific templates based on user selection.
- Observed behavior
- The VBA event no longer triggers upon exiting the content control, meaning templates are no longer hidden by default, likely due to disabled macros or an Office update.
Before troubleshooting macro settings, create a backup copy of your document to ensure your VBA code and bookmarks are safe while testing different solutions.
Enable Macros and Trust the Document
Check if a recent security update has disabled macros, which prevents the ContentControlOnExit event from running.
Microsoft frequently updates Office security settings, which can sometimes block macros in documents that previously worked without issue.
In Word, click on 'File' > 'Options' and select 'Trust Center' from the left sidebar. Click the 'Trust Center Settings' button.
Navigate to the 'Macro Settings' tab. Temporarily select 'Enable all macros' to test if the event fires, or select 'Disable all macros with notification' so you can manually allow them when opening the document.
Go to the 'Trusted Locations' tab, click 'Add new location', and select the folder where your VBA document is saved. Click 'OK' to save your settings.

Verify VBA Event Code Location and Tags
Ensure the VBA event procedure is placed in the correct module and that your content control tags match the code.
Roll Back or Repair Office Updates
If the problem began immediately after a Microsoft Office update, repairing the installation or rolling back the update can resolve the broken macro functionality.
Try WPS Office for Your Document Needs
If Microsoft Office updates continuously break your workflow or you need a reliable, lightweight alternative, WPS Office provides excellent compatibility with Word documents and supports advanced formatting features.
- 1. Download WPS Office: Visit the official WPS Office website and download the free installation package.
- 2. Install the Software: Run the installer and follow the quick on-screen instructions to set up the software.
- 3. Open Your Documents: Launch WPS Writer and open your .docx files to seamlessly continue your work.

Frequently Asked Questions
Why did my Word macro suddenly stop working?
Word macros often stop working due to recent Office security updates, changes in Trust Center settings that disable macros, or moving the document to an untrusted location. Ensure macros are enabled in the Trust Center.
Where should the ContentControlOnExit event be placed in VBA?
The Document_ContentControlOnExit event code must be placed within the 'ThisDocument' class module. It will not trigger if placed in a standard module.
How do I fix macros being blocked by security settings?
You can unblock macros by going to the document's file properties in Windows File Explorer, checking the 'Unblock' box at the bottom of the General tab, and then adding the file's folder to Word's Trusted Locations.




