Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

VBA - Outlook send to additional recipient

Hi

How do I upgrade the code below to add another recipient?
Set ObjOutlook = New Outlook.Application
    Set ObjOutlookMsg = ObjOutlook.CreateItem(olMailItem)
 
    With ObjOutlookMsg
       Set objOutlookRecip = .Recipients.Add("admin@macros-vba.com")
       objOutlookRecip.Type = olTo
       .Subject = "SUBJECT GOES HERE"
       Set objectlookAttach = .Attachments.Add(oPathAndFile)
    
       For Each objOutlookRecip In .Recipients
            If Not objOutlookRecip.Resolve Then
                 ObjOutlookMsg.Display
            End If
       Next
       .Display
       '~~> Uncomment the below to send the email
       '.Send
    End With

Open in new window

Avatar of Chris Bottomley
Chris Bottomley
Flag of United Kingdom of Great Britain and Northern Ireland image

      Set objOutlookRecip = .Recipients.Add("admin@macros-vba.com")
       objOutlookRecip.Type = olTo
        Set objOutlookRecip = .Recipients.Add("admin2@macros-vba.com")
       objOutlookRecip.Type = olTo
       Set objOutlookRecip = .Recipients.Add("admin3@macros-vba.com")
       objOutlookRecip.Type = olcc
       Set objOutlookRecip = .Recipients.Add("admin4@macros-vba.com")
       objOutlookRecip.Type = olbcc
 
Chris
 
ASKER CERTIFIED SOLUTION
Avatar of Chris Bottomley
Chris Bottomley
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Murray Brown

ASKER

Thanks very much