How to Reset Outlook VBA Code and Stop Folder Counts
Question details
The user needs to stop Outlook from displaying item counts for every folder caused by a VBA macro, and wants to learn how to access the editor to reset or remove the code.

- Product
- Microsoft Outlook
- Device & OS
- not provided
- Scenario
- Managing Outlook folders and troubleshooting unwanted item counts after adding or modifying a VBA macro.
- Observed behavior
- Outlook displays item counts for every folder automatically due to an active VBA macro running in the background.
Before editing your VBA code, verify that you have the necessary administrative permissions to modify macro settings in Outlook and temporarily disable any running scripts.
Remove or Comment Out the Unwanted Macro in Visual Basic Editor
Access the Visual Basic Editor to manually disable or delete the specific macro responsible for the automated folder counts.
This is the most direct method to stop unwanted behavior caused by custom scripts in Outlook. By commenting out the code, you preserve it for future reference without allowing it to run.
Launch Outlook and press Alt+F11 on your keyboard to open the Visual Basic Editor.
Navigate to Tools > Options in the top menu bar to review your current VBA editor environment settings.
Look through the Project Explorer pane on the left to find the module or script that contains the folder-counting macro.
Select the macro code and either delete it entirely, or type an apostrophe (') at the beginning of each line to comment it out and prevent it from executing.
Save your changes in the editor, close the Visual Basic window, and restart Outlook to apply the updates.

Create a Safe Replacement Folder-Counting Routine
If you still need to see folder counts but want them displayed safely without altering your folder tree interface, use a replacement macro that prints to the Immediate window.
Looking for a Lightweight Alternative to Microsoft Office?
While WPS Office does not include an email client like Outlook to manage VBA folder counts, it provides a powerful, free, and lightweight alternative to Word, Excel, and PowerPoint for all your document creation needs with seamless migration.
- 1. Download WPS Office: Visit the official WPS Office website and download the free installer.
- 2. Install the Suite: Run the installation file and follow the quick setup wizard to install the software.
- 3. Open and Edit Files: Launch WPS Office and open your existing Microsoft Office files with full format compatibility.

Frequently Asked Questions
Why does Outlook display item counts next to my folders?
Outlook displays item counts when a default setting is changed or a custom VBA macro is configured to automatically modify folder properties to show the total or unread number of items.
How do I access the Visual Basic Editor in Outlook?
You can access the Visual Basic Editor by opening the Outlook application and pressing the Alt and F11 keys simultaneously on your keyboard.
Is it safe to delete VBA macros in Outlook?
Yes, it is safe to delete custom VBA macros that you no longer need or that are causing unwanted interface changes. However, you should ensure you are not deleting essential organizational scripts provided by your IT department.




