Outlook Send Same Email to Different Recipients | VBA Macro #31

Share on facebook
Share on twitter
Share on linkedin
To BCC or to not BCC?  That is the question that comes to mind when emailing a variety of different recipients.  This is especially important if you are working with multiple clients.  You can BCC recipients so they can’t click reply all. Recipients won’t see who was emailed but that is actually the problem.  The value is knowing who was emailed so customers know if additional follow-up is needed.  Instead you can CC recipients but once someone hits Reply All the conversation can get out of control.  This can create a bigger problem if the email thread is across multiple parties. Sending separate emails creates more value for the customer but how do you do this efficiently and effectively? You could create new emails do a lot of copying and pasting but this isn’t a sustainable process. Good news is there is always a better way with VBA! Our new Outlook macro makes sending the same email to different recipients so easy! The Send Same Email to Different Recipients macro takes the Active open email and sends it to all the email recipients indicated in the VBA code.  The great thing is you can indicate multiple recipients per email creating a completely separate email thread. To get started simply draft your email as normal but instead of clicking Send run this macro.  The Email Subject and Email Body will be used in every email created.  Also, any email attachments in the Active email will be attached as well!  By Default, the generated emails will display for review before sending.  You can easily customize this macro to automatically send them!!!

See it in Action!

Watch this video to see this macro in action.

The Code

Here is the code for this macro. Make sure the following References are setup before running it: Visual Basic For Applications, Microsoft Outlook 16.0 Object Library
***Recent Code Updates
07.06.2021 Better handling of email signature and embedded images in email body.
'Leverage & Lean "Less Clicks, More Results"
Sub SendSameEmailDifferentRecipients()
' Means variable is in use
Dim Body As String '
Dim CCRecipients As String '
Dim Editor As Object '
Dim EmailCounter As String '
Dim fso As Object '
Dim NewEmail As Object '
Dim objAttachment As Object '
Dim oItem As MailItem '
Dim Outlook As Object '
Dim Recipients As String '
Dim Subject As String '
Dim TempFolder As Object '

On Error GoTo LeverageLean
 
'From current email copy the Subject and Body
Set oItem = Application.ActiveInspector.CurrentItem
Subject = oItem.Subject
Set Editor = oItem.GetInspector.WordEditor
Editor.Content.Copy

EmailCounter = 0
  
Do Until EmailCounter = ""
EmailCounter = EmailCounter + 1
If EmailCounter = "1" Then
Recipients = ""
CCRecipients = ""
ElseIf EmailCounter = "2" Then
Recipients = ""
CCRecipients = ""
ElseIf EmailCounter = "3" Then
Recipients = ""
CCRecipients = ""
ElseIf EmailCounter = "4" Then
Recipients = ""
CCRecipients = ""
ElseIf EmailCounter = "5" Then
Recipients = ""
CCRecipients = ""
Else 'No additional Recipients set so clear EmailCounter.
EmailCounter = ""
Recipients = ""
End If
  
If Recipients <> "" Then
Set Outlook = CreateObject("Outlook.Application")
Set NewEmail = Outlook.CreateItem(0)
NewEmail.To = Recipients 'Set Recipients indicated by EmailCounter above
NewEmail.CC = CCRecipients 'Set CCRecipients indicated by EmailCounter above
NewEmail.Subject = Subject 'Set Subject from the Current Email
If oItem.Attachments.Count > 0 Then 'If Attachments Exist on the Appointment
Set fso = CreateObject("Scripting.FileSystemObject") 'Set fso
Set TempFolder = fso.GetSpecialFolder(2)
For Each objAttachment In oItem.Attachments
objAttachment.SaveAsFile TempFolder.Path & "\" & objAttachment.fileName 'Save the Attachment to the Temporary Folder
NewEmail.Attachments.Add TempFolder.Path & "\" & objAttachment.fileName 'Add Attachment to Email
fso.DeleteFile TempFolder.Path & "\" & objAttachment.fileName 'Delete the Attachment in the Temporary Folder
Next
End If
NewEmail.Display
Set Editor = NewEmail.GetInspector.WordEditor
Editor.Content.Paste
'NewEmail.Send
End If
  
Loop
  
Exit Sub
  
LeverageLean:
MsgBox (Err.Number & " - " & Err.Description & vbNewLine & vbNewLine & "Don't hesitate to email me: brentschneider@leveragelean.com")
     
End Sub
'Stay Awesome

Macro Monday

Here is the Macro Monday video this macro was featured in. Watch this video to learn how to get the most out of this macro and start using it today!

Customization

These lines of code can be customized to personalize this macro.
27 through 47 Recipients = “” CCRecipients = “” To add Recipients and CC Recipients update these variables with email addresses throughout these code lines.
67. ‘NewEmail.Send To automatically send these generated emails remove the ‘ so this code lines is no longer a comment.

First time using VBA?

The Developer Tab is an additional section of the ribbon when activated allows you access to Visual Basic in Applications like Access, Excel, Outlook, PowerPoint, Word.
Setup Now
Once the Developer Tab is available you will have the capability to update your security to allow Macros to run in the current application.
Setup Now
A sub of code is a collection of objects and variables. For the code to successfully run a library of references needs to be set.
Setup Now
Subscribe as an Insider to receive additional rights.
If you like our content and want to show your support tip us here!

Contact Us

Looking to improve your computer processes?
Leverage & Lean is here to help!

Leverage & Lean

Is focused on improving computer processes by Leveraging programming and applying Lean principles. It is our goal to make you more efficient and effective on your computer producing “Less Clicks and More Results!”