Reply to Messages with Meeting Requests

In Reply to a Message with a Meeting Request Outlook MVP Diane Poremsky shows us how we can reply to messages with a meeting request in Outlook versions prior to 2010.

She correctly explains that you can simply drag an email to a calendar to get a meeting request created automatically. And normally I would suggest that you simply do that, instead of using VBA (or upgrading to Outlook 2010). But I don't like it because when you drag and drop the email, you still have to manually add attendees to the meeting.

So let's use some VBA to recreate this option. All we need to do is grab the current item and check if it's an email. If so, we create an appointment, add the recipients from the message to the meeting and display it so we can set meeting details such as location, time and reminder.

Sub ReplyWithMeetingRequest()

On Error GoTo ErrorHandler

Dim obj As Object
Dim msg As Outlook.mailItem
Dim meeting As Outlook.AppointmentItem
Dim i As Long

' get currently selected item
Set obj = ActiveExplorer.Selection.item(1)

' is it a mail item?
If TypeName(obj) = "MailItem" Then
  Set msg = obj
  Set meeting = Application.CreateItem(olAppointmentItem)

  With meeting
    ' it's a meeting
    .MeetingStatus = olMeeting
    ' same subject as the message
    .Subject = msg.Subject

    ' invite message recipients
    For i = 1 To msg.Recipients.count
      .Recipients.Add msg.Recipients(i)
    Next i

    ' invite sender
    .Recipients.Add msg.SenderName
    ' show meeting to set other details
    .Display
  End With

End If

ProgramExit:
  Exit Sub
ErrorHandler:
  MsgBox Err.Number & " - " & Err.Description
  Resume ProgramExit
End Sub

Assign this code to a toolbar button and you are ready to start scheduling meetings.

About JP

I'm just an average guy who writes VBA code for a living. This is my personal blog. Excel and Outlook are my thing, with a sprinkle of Access and Word here and there. Follow this space to learn more about VBA. Keep Reading »


Related Articles:


Share This Article:

Share and bookmark this articledelicious buttonfacebook buttonlinkedin buttonstumbleupon buttontwitter button

This article is closed to new comments. Why?
Peltier Tech Charting Utilities for Excel