An interesting problem came up in the Microsoft public newsgroups this week. Richard posts: "We have a specific user requirement to auto accept meeting requests only from some selected organizers, but I don't see any choice in Rule Wizard for meeting requests. Does anyone have an idea, please?"
Of course I have an idea. Begin with a rule using the conditions "from people or distribution list" and "uses the specified form", choosing the Meeting Request form under Application forms.
Since there is not an action to respond to meeting requests, you'll need to use a script to accept it. Outlook MVP Michal Bednarz offers this script, which you need to add to ThisOutlookSession before creating the rule.
This was tested in Outlook 2007 and should work in any version which supports the Run a Script action.
Sub AutoAcceptMeetings(oRequest As MeetingItem) If oRequest.MessageClass <> "IPM.Schedule.Meeting.Request" Then Exit Sub End If Dim oAppt As AppointmentItem Set oAppt = oRequest.GetAssociatedAppointment(True) Dim oResponse Set oResponse = oAppt.Respond(olMeetingAccepted, True) oResponse.Display End Sub
Open Outlook's VBA editor (Alt+F11), expand Microsoft Office Outlook Objects then double click on ThisOutlookSession. Type or paste the code into the module, then create the rule with the 'run script' Action and select this script
To decline a meeting, replace olMeetingAccepted with olMeetingDeclined:
Set oResponse = oAppt.Respond(olMeetingDeclined, True)
To Save with no response sent
To accept the meeting and add it to your calendar automatically, without sending a response, Christopher changed the last part of the code to:
Dim oResponse Set oResponse = oAppt.Respond(olMeetingAccepted, True) oResponse.Close (olSave) End Sub
To Delete from the Inbox once processed
Add the following before End Sub:
Apply rule to meetings scheduled for a specific day of the week
This edit uses the WeekDayName function to get the day of the week and automatically process the meeting. Use the full weekday name in the string.
dayWed = WeekdayName(Weekday(oAppt.Start))
If dayWed = "Wednesday" Then
Sub AutoAcceptMeetingsWed(oRequest As MeetingItem) If oRequest.MessageClass <> "IPM.Schedule.Meeting.Request" Then Exit Sub End If Dim oAppt As AppointmentItem Set oAppt = oRequest.GetAssociatedAppointment(True) dayWed = WeekdayName(Weekday(oAppt.Start)) If dayWed = "Wednesday" Then Dim oResponse Set oResponse = oAppt.Respond(olMeetingAccepted, True) oResponse.Send End If End Sub
Macro security needs to be set on Notify for all macros. Using Enable All macros is a poor choice as it is often reset to the signed macros only option by security software or updates. If you prefer, you can sign the macro using SelfCert and set security to Signed macros only. If you choose to use SelfCert, sign the macro after you are finished editing it as it will need to be re-signed after each edit.
To access macro security dialog, go to File, Options, Trust Center in Outlook 2010. Use Tools, Macros, Security menu in Outlook 2007 and older. When security is set to Notify, you will be asked if you want to run the macro each time you start Outlook.
Complete steps for using the VBA Editor and SelfCert are at How to use the VBA Editor
More Run a Script Samples:
- Create a rule to delete mail after a number of days
- Forward meeting details to another address
- How to Change the Font used for Outlook's RSS Feeds
- Keep Canceled Meetings on Outlook's Calendar
- Move messages CC'd to an address
- Outlook's Rules and Alerts: Run a Script
- Process messages received on a day of the week
- Read Outlook Messages using Plain Text
- Run a Script Rule: Change Subject then Forward Message
- Run a Script Rule: Send a new message when a message arrives
- Save Outlook email as a PDF
- Use a run a script rule to mark messages read