Checking for a Specific Message at a Set Interval

I put this post together for a Twitter user going by the name DerroldJess (DJ for short). DJ tweeted me asking if I could create a script that would check a mailbox every 15 minutes for a message with a specific subject, and display an alert if it did not find one. You can view the entire conversation here. The good news is that this is possible, although not from within Outlook. In order to make a check every 15 minutes, the solution needs a timer to trigger it. The only timer-like capability in Outlook is a reminder on a task or appointment, and for this that’s impractical. If the script only needed to run once a day, then I’d have gone that route and written this as an Outlook macro. Instead, I opted to write this using VBScript. VBScript runs outside of Outlook, so DJ can use Windows’ built-in task scheduler to run the task every 15 minutes.
Continue reading


Exporting Outlook Message Counts to Excel

I’m writing this post in response to a comment Shaima Alsaif left on my “Exporting Outlook Messages to Excel” entry from this last October. In the comment Shaima asked if it’s possible to alter the export to do the following:

  • Get message counts instead of messages
  • Add to the spreadsheet instead of overwriting it
  • Have the process run automatically each week

The answer to all three is “yes”. Doing this requires taking a different approach from the one I used in the original solution. The biggest change is that this solution uses VBScript instead of VBA. Here’s why. Outlook does not have a built-in means of scheduling code to run. It’s possible to get around that (e.g. using a repeating task coupled with an event handler that traps the ReminderFire event), but it’s better to use a true scheduler like the one built into Windows (i.e. Task Scheduler). To the best of my knowledge Windows Task Scheduler cannot call a VBA routine, hence the need to use VBScript instead.
Continue reading