Link to home
Start Free TrialLog in
Avatar of E C
E CFlag for United States of America

asked on

Code to run Outlook Rules at a scheduled time of day

I manage a team of 20 people. We all use Outlook 2010 connected to an Exchange 2010 Server. Because of the massive amounts of email that come in on a daily basis, I taught my users how to write Outlook rules that move incoming messages into subfolders.

This works great when you are sitting at your desk, because the Outlook subfolders are always visible and the subfolder turns bold to indicate that a new message has arrived.

However, this "immediate moving" of all incoming messages into subfolders is frustrating when you try to check your email from a smart phone.

Those of you who use Outlook rules to keep your Inbox tidy AND ALSO have a smart phone know exactly what I mean.

Example: I have a rule that says "if I receive a message from customer x, automatically move it to the 'customer x' subfolder."

My smart phone is not so smart when it comes to subfolders. I have to REMEMBER to check the subfolder from my smartphone, because it will not show you by default. In other words, you have to click on mail, then click on your inbox, then list your subfolders, then click on the subfolder name. ONLY THEN does your smart phone check the server for any new messages IN THAT FOLDER.

If you have 10 subfolders, you have to click on EACH of the 10 subfolders on your phone, then (each time) wait for it to connect to the server, and download new messages.

So, I thought of a potential "solution" to this curse ... during the day, FORGET about Outlook rules. Have ALL incoming messages throughout the day go to the Inbox. The benefit is that when you are using your smart phone, you don't have to keep manually clicking on every subfolder to look for new messages.

Then, every night, what if you could trigger Outlook to automatically run all of your rules against your Inbox, but only do this once per day, at night. That way when you arrive at the office the next day, your Inbox has magically been organized. The process repeats. During the day, all of your incoming messages go to your Inbox. At night, they get organized into their subfolders according to the Rules that were set up.

Again, the ONLY purpose for this is to make it MUCH easier to notice new incoming email on your smart phone.

Anyone here ever use a BlackBerry? Those guys had this feature MASTERED. In the world of BlackBerry, there ARE no subfolders. ALL of your email comes to one virtual "inbox". Now, when you got to the office and checked your email, sure enough your Outlook rules had been running all this time and in Outlook, all of your messages are neatly stored away in their subfolders (because your Outlook rules did that). In other words, Outlook rules should be just that - OUTLOOK rules. Not smart phone rules. After several iPhones and Android phones, I haven't found a single smart phone that nailed Email the way BlackBerry does.

I don't think it's possible to schedule Outlook rules to run at a certain time (i.e. only at night), so I thought there might be a way to do this programatically.

So what I want to do is this:
- During the day, 7 of my 10 Outlook rules are 'disabled'. This prevents my incoming email (during the day) from being magically redirected (i.e. hidden) in subfolders (where I will never notice them as long as I am checking email from my smart phone)
- At 10 pm, I want a scheduled task (?) on my desktop to (1) enable those 7 Outlook Rules, and then (2) run them against my Inbox, and then (3) disable those 7 rules.

Is this possible? (Or has anyone figured out a more elegant way to have the best of both worlds?)
Avatar of apache09
Flag of New Zealand image

Theres a few factors that may need to be considered here.

These Rules are Client Side only Rules
This means they will only run when outlook is open.

So if your away from your desk or offsite, and your outlook is open and running the rules will be applied as soon as an mail item arrives.

Therefore, If you sync you mobile device, the end result will see the mail items in their subfolders

However, if you know your leaving the office.
If you close out of outlook
This will in turn stop the rules from processing

Then when checking mail from your mobile device you should see the mail items in the inbox without the rules being applied

Now for the Overnight Idea

You could do this
However, again because Outlook Rules are client Side and only work when outlook is open
This mean you have to leave your computer on and logged in All Night

Although not reccomended
You could create a bat File that Opens OUtlook at 10:00PM
Once open outlook will process the rules
Then after a short delay, you can set the bat file to close outlook

Then when you get in the next morning all the rules will have been processed
But again, there are several issue leaving a PC on and RUnning while logged in over night
Avatar of E C
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of E C


I am still trying to find a way to trigger Outlook Rules to run only at a certain time of day. Out of the box, Outlook does not let you schedule rules. In other words - if you create an Outlook Rule and turn it on, it is ALWAYS on.

I'll try to find out if Outlook 2013 adds this feature. But if not, I want to find some way to programmatically (through code) enable and disable rules on a pre-configured schedule.