Hi, I am trying to send automatic mail via Vba code.
Code I have is working fine except I am not able to add more than 20 names in CC.
Please help. Below is the code
Code I have is working fine except I am not able to add more than 20 names in CC.
Please help. Below is the code
Code:
Sub attachment()
Dim strlocation As String
Dim outapp As Object
Dim outmail As Object
Set outapp = CreateObject("outlook.application")
Set outmail = outapp.createitem(0)
strlocation = "C:\Users\ah0118261\Desktop\Goals 2016-FPM Team.pptx"
With outmail
.To = ""
.CC = ""
.BCC = ""
.Subject = "Training Structure"
.Body = "Please write your content"
.Attachments.Add (strlocation)
.display
End With
Set outmail = Nothing
Set outapp = Nothing
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub
Last edited by a moderator: