Easily Activate Outlook Rule with Your Keyboard

Easily-Activate-Outlook-Rule-with-Your-KeyboardIf unread emails are a pain for you, then this tutorial will help. 

I love getting emails!

I see it as a great opportunity for me to help a reader

And maybe even earn more trust from you my audience

And it seems to work:

 

IN THIS TUTORIAL YOU’LL LEARN ABOUT:

  • How my own daily habits were keeping me from tackling the email problems I was facing.
  • How initially I couldn’t imagine a way to get my inbox to zero.
  • My plan of attack after using Autohotkey to run rules for my Outlook inbox. 
  • The decision to use rules to not declare email bankruptcy.
  • How many emails a day I was checking but not reading, and how many I needed to be reading.
  • The importance of canned rules and how a script helped maximizes my time answering emails.
  • How the script helps me approach my inbox each day so I can answer more emails.
  • What code my Outlook rule running script is made of.

 

Degree of difficulty:

level 5

In this tutorial we will use a script made with the free scripting language AutoHotkey.

Before we start, all you need are 3 things:

And 17 lines of plain text from this step by step tutorial.

 

Novices are recommended to have a look at this Tutorial

As always free download links at the end of this post, for both the finished working script with all the shown lines and also a compiled EXE with the same for those who’d only like to try and see how easy it is to activate an Outlook inbox rule.

 

As time goes on and Jszapp.com grows, so does the number of emails, I receive each day

Both user emails and system emails:

I eventually get to a point where I need to clean my inbox so I can keep up.

I usually check the title of all incoming emails on my phone

and then use Outlook to reply:

Read up and end my day with zero unread emails in my inbox.

On busy days I sometimes end the day with over a 100 unread emails

mostly system emails!

When that happens I’m not happy!

 

Until now I needed to find extra time and go over all the unread emails in my Inbox

But by this time one-hundred often turned into an inbox of 200 unread emails.

When I opened Outlook I simply scrolled over all the unread emails until

I found an unread user email:

Which made me not deal with most system mails or otherwise informative mails

In turn my inbox of 300 become inbox of 400 then 500 etc.

 

Occasionally:

I’d need to really use a good amount of time and maybe a productivity tip!

Which would help chip away at those numbers a little bit faster but I was still

Using too much of my precious time on no longer relevant emails. ( Click here to tweet )

 

7 days ago I had 967 unread emails in my main inbox.

Yes, almost a thousand!

 

At that point, each new email that arrives becomes a constant reminder of just how many emails I might miss!

It makes me think about the people I might be letting down.

And in turn it also made me think about whether or not an Outlook rule could help

Even just a little!

At least bring down the number of unread emails.

 

Reading up on Outlook rules:

It was clear to me that most rules is used when a mail arrives.

But none really seemed easy to use!

In a day by day way at least.

I needed something to help me with the emails already in my inbox:

And i needed them to land in my inbox to easily read the titles from my phone before moving them.

 

I found that:

I needed to run each rule by going to the rules setup dialog and pick a rule from a list of all the options

Or browser all the premade rules every time I needed to use one!

I wasn’t keen on going that route.

 

Thinking back:

I remembered helping someone use Autohotkey to programmatically find all available outlook rules

With that in mind!

I was sure I could make rules easier to activate.

 

I don’t know why I didn’t do this before:

Use a Autohotkey script to help me manage my inbox. ( click to tweet )

 

Example video: (2:46)

Easily Activate Outlook Rule with Your Keyboard

 

IN COMES THE SCRIPT!

I’d like to show you how you can make an Autohotkey script that will activate any Outlook rule when you wish, by the press of a keyboard shortcut

It’s awesome and has helped me a lot.

So awesome, in fact, that in the few days I have used it

It has helped me go from 900+ unread emails:

To now! Helping me consistently reach inbox zero each day.

Let me share exactly how to tackle making the script

I will also find it quite interesting to hear your reactions to my Outlook inbox script.

So please do comment:

 

1: The Top of the Script (the Auto-execute Section)

 

On line 1 the constant ‘olRuleReceive’ will be set to the value 0

 

One the next line you need to store the name of the rule you wish the Autohotkey script to activate

That is all there needs to be preset before you can start working on your hotkey routine.

 

Hotkey-definition

2: Hotkey definition

Start be using the #IfWinActive directive so the your hotkey routine runs only when outlook is active

“rctrl_renwnd32” is the class name of an Outlook window

 

Here you get to pick the key you wish to use to activate the rule you put in the name of above in the variable ‘rulename’

 

I use F7 as my hotkey:

What key did you pick?

 

3: COM Object

Here you will use the built-in ComObjActive() function to store the active Outlook Application COM object in the variable ‘oOutlook’

 

This time I will just show you how to do this for default Store ( i.e. the default email account ) with this line you store the current session’s default account object in the variable called ‘Store’.

You’re always welcome to ask me for help if you need it to work with one of your other accounts.

 

Time to use the Store objects GetRules method to get an array of all the current rules you have in Outlook, this will let the script loop over them and compare them to the name of the rule you wish to activate.

 

Now what folder do you wish the rule to act on?

In this example I will use it on the current folder ( i.e normally my inbox )

Here I the := operator to store the current folder object in the ‘cf’ variable

 

for-loops

4: For-loop

Time to loop over the rules in the rules array your stored above

This loop will also be the start of a block {…} any code within this block is repeated once for each value in the rules array.

Now with each iteration of the for-loop the ‘rule’ variable will hold the current rule object

First we use an if-statement to check the rules type so we only act on rules of the right type (in this case rules used on received emails )

I do this so I can have rules with the same name for both incoming and outgoing mails but with different handling.

 

Next you use one more if to check the current rule’s name against the name you input on the 2nd line now stored in the variable ‘rulename’

 

If the current rules name is the one you want the script flow will enter this if block

Inside this block, we know that the rule object in the rule variable has the name we want

So now you can use the rule objects method Execute it needs two parameters 1st one tells outlook to show the rules execution progress or not and the 2nd one tells outlook what folder to run this rule against.

 

Still within this block you also store the name of the rule you just executed in the variable “runrule” this will let you display its name later.

 

The next tree lines hold the closing brackets from the tree blocks above aka the for-loop, type-if and name-if.

 

 

5: Display the executed rule

Lastly you can use the MsgBox command to display an ending message telling you what rule(s) was activated.

 

Now all that’s left is to tell the script routine to stop/return to the state it was in before the press of the hotkey.

For that you use the return command

 

That’s all to making a script that will:

Easily Activate An Outlook Rule Using Only Your Keyboard. ( click here to tweet )

 

LINKS-AND-RESOURCES

LINKS AND RESOURCES:

 

Downloads (FREE)

As I mentioned at the start of this tutorial, I uploaded the script as both an .exe and .ahk resource. Simply click on one of the buttons below, to add it to your cart then go to checkout and enter your name and email and the download is sent your way!

Script (.ahk)

 

Application (.exe)

 

MAY I ASK YOU FOR A FAVOR?

Thanks again for reading this tutorial. If it has helped you in any way, shape or form, please share it using the social media buttons you see on the page.

Additionally, if you have any questions you’re always welcome to drop me an email.

I hope you enjoyed reading about my inbox pain in this tutorial, and I hope the time you invested in reading today will help you with your own inbox problems.

Remember to subscribe to my email updates to get automatic updates.

HOW MANY EMAILS IN YOUR INBOX DO YOU STILL NEED TO READ RIGHT NOW? BE HONEST!

Leave a comment below and let the community know. If you don’t have very many, what’s your secret? If you have as many as me, are you going to use this script to do something about it?

Thanks again, see you next time!

 

jszadmin

Drafter and Webmaster at JSZapp.com
I’m Jackie Sztuk or JSZ. I have a Drafter’s degree from Copenhagen Technical College (KTS) and my passion for windows scripting is what makes me want to help as meny as i can by writing great and easy to follow How-to's.

jszadmin

I’m Jackie Sztuk or JSZ. I have a Drafter’s degree from Copenhagen Technical College (KTS) and my passion for windows scripting is what makes me want to help as meny as i can by writing great and easy to follow How-to's.

Leave a Reply