Sometimes, you may want to add the list of attendees into the body when sending a meeting invitation in Outlook. This post will teach you how to let Outlook to auto accomplish it by VBA.
When you send a meeting invitation, at times, for some reasons, like making it convenient for recipients to know the other attendees, you may desire to insert the list of attendees into the meeting body. In this case, with no doubts, inputting one by one manually is considerably troublesome. Therefore, why don’t you resort to Outlook VBA? By VBA, you can get it without breaking a sweat since Outlook can do it automatically. Now read on to learn the detailed steps and VBA codes.
Auto Insert the List of Attendees into the Body When Sending a Meeting Invitation
- In the first place, start your Outlook program.
- Then switch to “Developer” tab and hit “Visual Basic” button. Or you can just press “Alt + F11” key buttons.
- Next you will get into the VBA editor interface successfully.
- Subsequently, you need to open the “ThisOutlookSession” project.
- Then copy and paste the following VBA codes into this project window.
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) Dim objMeetingRequest As Outlook.MeetingItem Dim objMeeting As Outlook.AppointmentItem Dim objRecipients As Outlook.Recipients Dim objRecipient As Outlook.recipient Dim strAttendeesList As String Dim strPrompt As String Dim nResponse As Integer If TypeOf Item Is MeetingItem Then Set objMeetingRequest = Item Set objMeeting = objMeetingRequest.GetAssociatedAppointment(True) Set objRecipients = objMeetingRequest.Recipients strPrompt = "Do you want to insert the list of attendees into the body of this meeting request?" nResponse = MsgBox(strPrompt, vbYesNo + vbQuestion, "Confirm Inserting Atteendee List") If nResponse = vbYes Then For Each objRecipient In objRecipients strAttendeesList = strAttendeesList & vbCrLf & objRecipient.Name & ":" & vbTab & objRecipient.Address Next 'insert the list of attendees into the end of body objMeetingRequest.Body = objMeetingRequest.Body & vbCrLf & vbCrLf & "Below are the list of the attendees:" & vbCrLf & strAttendeesList objMeeting.Body = objMeeting.Body & vbCrLf & vbCrLf & "Below are the list of the attendees:" & vbCrLf & strAttendeesList End If End If End Sub
- After that, you ought to sign this code.
- Later you can change your Outlook macro settings to only permit the signed macros.
- Finally you can have a try.
- Firstly, compose a meeting invitation as usual.
- Then click the “Send” button.
- Subsequently, you will receive a prompt asking if you want to insert the list of attendees.
- When you click “Yes”, the list of attendees will be added to the body and Outlook will start to send the meeting invitation.
- After it sent out, you can open it. The list of attendees will be added like the following screenshot:
Resolve Outlook Issues in Time
It is highly suggested to solve the Outlook errors as soon as possible. Otherwise, if issues get accumulated, you will encounter Outlook corruption finally one day. For the small issues, you can simply use inbox repair tool. But for severe troubles, you have to resort a more experienced tool, such as DataNumen Outlook Repair.
Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including corrupted SQL Server and outlook repair software products. For more information visit www.datanumen.com