Recently I signed up for an account at Quora. One of the first Outlook questions I encountered was this one from Thomas Foote. Thomas is looking for a way to send a message to just those meeting invitees that accepted the meeting request. I explained to Thomas that while Outlook does not have a built in means of doing this, it is possible to do it with a script (macro).
This macro is very simple. It creates a new message then opens the selected meeting/appointment and loops through the list of invitees. If an invitee is a person, not a resource, and if they accepted, then they are added to the To line of the message. The message is then displayed on screen.
Instructions.
Thomas has Outlook 2010, which I still haven’t loaded yet. I am therefore unable to provide him with a complete set of instructions for adding the code. The best I can do is provide instructions for Outlook 2007 and hope that he can adapt them to Outlook 2010 without too much trouble.
- Start Outlook
- Click Tools > Macro > Visual Basic Editor
- If not already expanded, expand Microsoft Office Outlook Objects
- If not already expanded, expand Modules
- Select an existing module (e.g. Module1) by double-clicking on it or create a new module by right-clicking Modules and selecting Insert > Module.
- Copy the code from the Code Snippet box and paste it into the right-hand pane of Outlook’s VB Editor window
- Edit the code as needed. I included comments wherever something needs to or can change
- Click the diskette icon on the toolbar to save the changes
- Close the VB Editor
Sub SendToAccepted() Dim olkApt As Object, olkMsg As Outlook.MailItem, olkRcp As Outlook.Recipient On Error Resume Next Select Case TypeName(Application.ActiveWindow) Case "Explorer" Set olkApt = Application.ActiveExplorer.Selection(1) Case "Inspector" Set olkApt = Application.ActiveInspector.CurrentItem End Select If TypeName(olkApt) <> "AppointmentItem" Then msgbox "The item you selected is not a meeting/appointment. Processing terminated.", vbCritical + vbOKOnly, "Send to Meeting Attendees" Else Set olkMsg = Application.CreateItem(olMailItem) With olkMsg .Subject = olkApt.Subject For Each olkRcp In olkApt.Recipients If olkRcp.MeetingResponseStatus = olResponseAccepted Then If olkRcp.Type <> olResource Then olkMsg.Recipients.Add olkRcp.Address End If End If Next End With olkMsg.Display End If Set olkApt = Nothing Set olkMsg = Nothing Set olkRcp = Nothing End Sub
Thanks – this worked perfectly for me as well. Thank you so much!
You’re welcome, David. I’m happy it worked for you.
AWESOME! It worked for all my needs! I created separate ones for declined and none! I’ve been wanting to do this forever! 🙂
I’m glad you like it, Terrell.
Open the meeting/(calander item) and run the macro.
<– info i needed.
Helped me David. Thanks, Feris
You’re welcome, Feris!
Thank you so much David, you saved me so much time. Very happy. Can I do the same thing but put the names of who accepted into Excel instead?
You’re welcome, Maria.
Are you saying that you want to export the names of the staff that accepted to Excel?
Love it. Thanks David.
Thanks, Greg!
This is exactly what I have needed for some time! I changed the code to use the Name instead of address since the Email item will resolve names. Otherwise the existing code worked perfect for me. I created a macro for each of the possible responses, including no response. Thank you!
You’re welcome, Lori. Glad it proved useful.
Is it possible to write a script to send a message to those that have not replied to the meeting request?
Yes, it is. In fact it’s a very simple change. All you need do is change olResponseAccepted to olResponseNone on line 17 of the code. Now instead of picking out those recipients that have responded the script will pick out those that have not responded. I recommend changing the name of the subroutine too, e.g. SendToNotReplied, but that’s not a requirement just a suggestion.
Pingback: Metrics Marketing Group to Offer Usability Evaluations at Annual Online Marketing Summit 2011 | Green Living Tips | Information and Free Resources |