Occasionally, when I’m not at work, I find myself wanting to know what tomorrow’s schedule looks like. Since my employer has disabled calendar syncing, I’m usually faced with two options:
- Go to my home computer, remote into my work computer, and check my calendar
- Decide it’s too much work and give up
Of course I could go with the first option. I know I could. You know I could. But we both know what option I go with – every time. So I’m left there on the couch, staring at my computer across the room, thinking “I can do this… but it’s all the way over there…”
It was that inherent laziness that drove me to spend hours working tirelessly on a way to see my agenda without ever leaving the couch. Now, all I have to do is send a specific email from my phone to my work computer, and it will email me back a nicely formatted list of all the meetings I have for that day. Problem solved!
“Laziness is the mother of invention.”
– Me
The Code
It might look scarier than my last post, but the below code really isn’t that bad, and it’s actually easier to implement. The only reason it’s even this large is that I wanted to format the email with a pretty HTML table. Without that, it would only be about 20 lines long.
So, here it is. I’ll tell you how to set it up below.
Setting Up the Code
- In your work computer’s Outlook, press Alt+F11 to open the VBA Editor window
- In the left pane, navigate to Project1 > Microsoft Outlook Objects > ThisOutlookSession
- Copy/paste the above code into ThisOutlookSession
- If you happen to already have a sub named
Application_NewMailEx
in there, you’ll have to do some editing, because the name is important, and you can’t have duplicate subs. If you’re not sure what to do, just leave a comment and I’ll help as much as I can.
- If you happen to already have a sub named
- Change the 2 instances of
<address@domain.com>
to your email address - Done!
Using the Code
Now here’s the easy part. All you have to do is email your work address from the address you just added to the code. If you use the word “agenda” or “schedule” in the subject line, along with a day of the week, you should get an email back with a nicely formatted table listing all your meetings for that day. Here are some example subject lines that would all give you exactly what you’d expect:
- Today’s Schedule
- tomorrow’s agenda
- agenda Friday
Right now, it only accepts day names up to a week from today. I could have made it accept actual dates as well, but I was too lazy.
Anyway, I hope you like it. And, as always, if you have any questions or comments, feel free to post them below!