Autoaccept a Meeting Request using Rules

Last reviewed on May 22, 2013

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.

Create a rule

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.

The Code

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

How to use

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:

oRequest.Delete

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

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

Written by

Diane Poremsky
A Microsoft Outlook Most Valuable Professional (MVP) since 1999 and involved in IT support since 1985, Diane is the author of several books and video training CDs and online training classes for Microsoft Outlook. You can find her helping people online in Outlook Forums as well as in the Microsoft Answers and TechNet forums.