Hey all! I haven't used this function before and can't find syntax or arguments for it. Can someone modify this code to send 1 mail message to all the recipients rather than an individual message to each? Thanks!
Sub send_email()
' To use this code,
' Type Subject in A1
' Type body of messages in A2
' list of recipients in J3, j4 and so on
'
Dim emailx()
Dim ds, ii, i, addx, ToRecipientsList, myOlApp, olMailItem, myItem, myRecipient
ds = Worksheets("Options"
.Range("J1"
.Value
'number of recipients. I type a formula that count number of recipient in J1.
ReDim emailx(ds) 'redim array of recipients
Range("J3"
.Activate
' arraying recipients
For ii = 0 To ds - 1
emailx(ii) = Range("J3"
.Offset(ii, 0).Value
Next ii
'Get mail subject & message from worksheets
mailsubject = Range("A1"
.Value
Body1 = Range("A2"
.Value 'you can modify the message as you like
For i = 0 To ds - 1 Step 1
Set myOlApp = CreateObject("Outlook.Application"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Set myItem = myOlApp.CreateItem(olMailItem)
Set myRecipient = myItem.Recipients.Add(emailx(i))
myItem.Importance = olImportanceHigh
myItem.Subject = mailsubject
myItem.Body = Body1
myItem.send
Next i
End Sub
Sub send_email()
' To use this code,
' Type Subject in A1
' Type body of messages in A2
' list of recipients in J3, j4 and so on
'
Dim emailx()
Dim ds, ii, i, addx, ToRecipientsList, myOlApp, olMailItem, myItem, myRecipient
ds = Worksheets("Options"
'number of recipients. I type a formula that count number of recipient in J1.
ReDim emailx(ds) 'redim array of recipients
Range("J3"
' arraying recipients
For ii = 0 To ds - 1
emailx(ii) = Range("J3"
Next ii
'Get mail subject & message from worksheets
mailsubject = Range("A1"
Body1 = Range("A2"
For i = 0 To ds - 1 Step 1
Set myOlApp = CreateObject("Outlook.Application"
Set myItem = myOlApp.CreateItem(olMailItem)
Set myRecipient = myItem.Recipients.Add(emailx(i))
myItem.Importance = olImportanceHigh
myItem.Subject = mailsubject
myItem.Body = Body1
myItem.send
Next i
End Sub