When you’ve created a rule to directly delete the most obvious spam messages, rather than letting them go to the Junk E-mail folder, you might have noticed that this method isn’t always successful.
This is because once a message has been marked as Junk via the Junk E-mail Filter, no rules will be executed for that message. The reasoning behind this is to prevent it from being moved out of the folder again or to have any other undesirable action being executed because of it (like auto-replying to it).
While you could still manually execute your anti-Junk rules against the Junk E-mail folder to speed up your reviewing process, it is a quite cumbersome process to get to the option and select the rules to execute.
With the VBA macro from this guide, you can execute all your anti-Junk E-mail rules against your Junk E-mail folder with a single click.
Run rules manually
Before getting to the automated VBA solution, let’s quickly look at what it takes to do it manually.
- Open the “Manage Rules & Alerts” dialog
- File-> Manage Rules and Alerts
- Click on the button: Run Rules Now…
- Locate and select your anti-Junk rules.
- Select the Junk E-mail folder.
- Click Run Now.
Even if you have only 1 anti-Junk rule and are already in the Junk E-mail folder, that is still at least 6 clicks and 3 different screens/dialogs you have to deal with. So Junk E-mail is still wasting your time!
Running your own Junk Filtering rules is quite cumbersome.
RunAllJunkRules VBA macro
The RunAllJunkRules macro automates the above process and will run all rules which have the word “Junk” in them (case insensitive).
There is not even a need to select your Junk E-mail folder first or to have the rules enabled in your list of rules (which means that it won’t count for your Exchange rule limit either).
Outlook will let you know when it is done executing the rules against your Junk E-mail folder and will display an overview of the executed rules.
Quickly clean up your Junk E-mail with the RunAllJunkRules macro.
Use the following instructions to configure the macro in Outlook;
- Download this code-file (
runalljunkrules.zip) or copy the code below.
- Open the VBA Editor (keyboard shortcut ALT+F11).
- Extract the zip-file and import the
RunAllJunkRules.basfile via File-> Import…
If you copied the code, paste it into a new module.
- Sign your code so you won’t get any security prompts and the macro won’t get disabled.
- Add a button for easy access to the macro or press ALT+F8 and select the macro you want to execute.
Add a button to the Ribbon or the QAT to run all your Junk E-mail rules.
The following code is contained in the zip-file referenced in the Quick Install. You can use the code below for review or manual installation.
Click in the area above and press CTR+A to select all. Press CTRL+C to copy the code.