Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sendmail with a named cell value as recipient
Have been working up an app and need to send emails from it.
I have reviewed Ron de Bruin's excellent articles and have configured code to work. Using Sendmail I can happily email colleagues if I use the prescribed syntax: Activeworkbook.Sendmail Recipient, Subject Sooooooo, Activeworkbook.Sendmail ", "Forcast " & Format(Now, "mm-dd- yy") After a dialogue warning asking permisssion about sending the mail it works just fine with Outlook. However I want to use the recipient name based on the value in a named cell in the workbook For example a cell NAMED "MgrEMail" with the value as the current value I have tried the obvious .SendMail MgrEMail, "Forcast " & Format(Now, "mm-dd-yy") but it just opens Outlook without a recipient. Is there a way to do this? Thanks, Dennis |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sendmail with a named cell value as recipient
Private Sub sendSheet()
Dim eMailAddress As String eMailAddress = Range("MgrEMail").Value ActiveWorkbook.SendMail _ Recipients:=eMailAddress, _ Subject:="Forcast " & Format(Date, "mm-dd-yy ") End Sub "ssGuru" wrote: Have been working up an app and need to send emails from it. I have reviewed Ron de Bruin's excellent articles and have configured code to work. Using Sendmail I can happily email colleagues if I use the prescribed syntax: Activeworkbook.Sendmail Recipient, Subject Sooooooo, Activeworkbook.Sendmail ", "Forcast " & Format(Now, "mm-dd- yy") After a dialogue warning asking permisssion about sending the mail it works just fine with Outlook. However I want to use the recipient name based on the value in a named cell in the workbook For example a cell NAMED "MgrEMail" with the value as the current value I have tried the obvious .SendMail MgrEMail, "Forcast " & Format(Now, "mm-dd-yy") but it just opens Outlook without a recipient. Is there a way to do this? Thanks, Dennis |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sendmail with a named cell value as recipient
On Jul 2, 6:44 pm, Mike wrote:
Private Sub sendSheet() Dim eMailAddress As String eMailAddress = Range("MgrEMail").Value ActiveWorkbook.SendMail _ Recipients:=eMailAddress, _ Subject:="Forcast " & Format(Date, "mm-dd-yy ") End Sub Thanks Mike. It worked perfectly with Outlook. I've also added some other ranges to the subject and attached file name using the same code. Any known problems with other eMail clients? Eudora, LotusNotes, etc.. Dennis |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
inserting a named range into new cells based on a named cell | Excel Discussion (Misc queries) | |||
Cell Fill Color and text color - changes for recipient | Excel Discussion (Misc queries) | |||
SendMail | Excel Programming | |||
If any cell in named range = 8 then shade named range | Excel Programming | |||
formula for named cell/range based on cell values | Excel Programming |