emailing recipients from a list in Excel

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

I have the code to e-mail a spreadsheet and/or a reference
of cells to multiple recipients if I list the recipients
in the code. (recipients = array:("user1", "user2"))

Is there a way to have the code reference the spreadsheet
for the list of names instead of having them hard coded?

Also, Is there a way to turn off the security prompt that
either Outlook or Excel displays when sending an email?
(You are about to send an e-mail, are you sure you want to
do this?)

Thanks in advance!!
 
Hi Jeff,

The following macro will put all the contents of Column A in an Array
called Recipients:

Sub StoreRecipients()

Dim i As Integer
Dim Recipients() As Variant
i = 1

Do Until Cells(i, 1) = ""
ReDim Recipients(i)
Recipients(i) = Cells(i, 1)
i = i + 1
Loop

End Sub
 
Jeff
I have the code to e-mail a spreadsheet and/or a reference
of cells to multiple recipients if I list the recipients
in the code. (recipients = array:("user1", "user2"))

Is there a way to have the code reference the spreadsheet
for the list of names instead of having them hard coded?

Dim olMi as MailItem
Dim cell as Range

For Each cell in Range("A1:A10")
olMi.Recipients.Add cell.Value
Next cell
Also, Is there a way to turn off the security prompt that
either Outlook or Excel displays when sending an email?
(You are about to send an e-mail, are you sure you want to
do this?)

See here

http://www.rondebruin.nl/sendmail.htm#Prevent

There is no good way, in my opinion, but at least you'll know.
 
Back
Top