Outlook allows for rules to be created, and one of the options a rule can do is to run a “script”. Don’t be confused by the name - this is more a VBA function or macro, and NOT an external script.
Assuming your’re using Outlook 2007, do the following:
Press Alt-F11 to open the Visual Basic Editor, then copy/paste the following code into it:
Sub CustomMailMessageRule(Item as Outlook.MailItem)
Dim email as MailItem
Set email = Item
Dim meetingRequest As AppointmentItem
Set meetingRequest = Application.CreateItem(olAppointmentItem)
meetingRequest.Body = email.Body
meetingRequest.Subject = email.Subject
meetingRequest.Start = email.SentOn
meetingRequest.End = email.SentOn
meetingRequest.ReminderSet = True
meetingRequest.ReminderMinutesBeforeStart = 1
meetingRequest.Save
End Sub
Once you’ve saved the project in the code editor, you can close it.
The next step is to set up a new mail rule. In my case, I have a dedicated folder in my mailbox called Helpdesk and I have a rule that checks all messages when they arrive. If any new message was sent from the helpdesk e-mail, the rule fires and the message is moved to the folder. Part of that rule also runs the script (when you’ve saved the code above the project name you used will be listed as an available script).
This results in an Outlook appointment being created. As my phone syncs over the air, I get these transferred to my phone, too.
There are a few gotchas:
-
This is a local rule that runs within Outlook. If you want it to run while you’re out and about, Outlook must remain open, otherwise it’ll only run next time you open Outlook.
-
If you create a helpdesk ticket via Spiceworks, and not by e-mailing your helpdesk e-mail addie, it may not work - depending on how you’ve configured you installation. In our case all new tickets are exclusively created via e-mail, so it works fine for us.
-
Spiceworks doesn’t do time management for you, nor does the bit of code. You may still prefer to go move the appointment to a different date and time, and must do so manually.
Enjoy!
Sub CustomMailMessageRule(Item As Outlook.MailItem)
Dim email As MailItem
Set email = Item
Dim meetingRequest As AppointmentItem
Set meetingRequest = Application.CreateItem(olAppointmentItem)
meetingRequest.Body = email.Body
meetingRequest.Subject = email.Subject
meetingRequest.Start = email.SentOn
meetingRequest.End = email.SentOn
meetingRequest.ReminderSet = True
meetingRequest.ReminderMinutesBeforeStart = 1
meetingRequest.Save
End Sub Sub CustomMailMessageRule(Item As Outlook.MailItem)
Dim email As MailItem
Set email = Item
Dim meetingRequest As AppointmentItem
Set meetingRequest = Application.CreateItem(olAppointmentItem)
meetingRequest.Body = email.Body
meetingRequest.Subject = email.Subject
meetingRequest.Start = email.SentOn
meetingRequest.End = email.SentOn
meetingRequest.ReminderSet = True
meetingRequest.ReminderMinutesBeforeStart = 1
meetingRequest.Save
End Sub
Sub CustomMailMessageRule(Item As Outlook.MailItem)
Dim email As MailItem
Set email = Item
Dim meetingRequest As AppointmentItem
Set meetingRequest = Application.CreateItem(olAppointmentItem)
meetingRequest.Body = email.Body
meetingRequest.Subject = email.Subject
meetingRequest.Start = email.SentOn
meetingRequest.End = email.SentOn
meetingRequest.ReminderSet = True
meetingRequest.ReminderMinutesBeforeStart = 1
meetingRequest.Save
End Sub