ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Send e-mail via macro (https://www.excelbanter.com/excel-programming/403968-send-e-mail-via-macro.html)

RobinK

Send e-mail via macro
 
Excel 2003, SP 2

In cell A1 I have a date. If that date is greater than or equal to Today -
7 days, then I want to send an e-mail to the recipient in cell A2 (this cell
already has a hyperlink to the e-mail address), and attach the document in
cell A3 (which also contains a hyperlink to the document). Of course, the
references (A1, A2, A3) will be to the same columns but different rows as the
spreadsheet is populated.

I would like the subject of the e-mail to be automatically filled in as
€śPlease Review,€ť the body of the e-mail to say €śPlease review the attached
document and return to me as soon as possible,€ť and the cc: field
automatically populated with another e-mail address.

Ive figured out how to activate the hyperlink in cell A1, but cannot figure
out how to:

1. Attach the document thats hyperlinked in cell A3
2. Automatically populate the subject line, the body of the e-mail, and the
cc: field.

Ultimately, this macro would run on the €śon open€ť event. Consequently, I
have no idea (or even how to search the discussion groups) how to find all
instances in the worksheet that meet the criteria of Today - 7 days.

Heres what I have so far:

Dim CalDate As Integer

CalDate = 7

If Today - A1 <= CalDate Then

Range("A2").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True

End If

End Sub

Thanks in advance for your help!


FSt1

Send e-mail via macro
 
hi robin,
see this site.
http://www.rondebruin.nl/sendmail.htm
email anyway you want to. has sample code, downloadable example files ect.

Regards
FSt1


"RobinK" wrote:

Excel 2003, SP 2

In cell A1 I have a date. If that date is greater than or equal to Today -
7 days, then I want to send an e-mail to the recipient in cell A2 (this cell
already has a hyperlink to the e-mail address), and attach the document in
cell A3 (which also contains a hyperlink to the document). Of course, the
references (A1, A2, A3) will be to the same columns but different rows as the
spreadsheet is populated.

I would like the subject of the e-mail to be automatically filled in as
€śPlease Review,€ť the body of the e-mail to say €śPlease review the attached
document and return to me as soon as possible,€ť and the cc: field
automatically populated with another e-mail address.

Ive figured out how to activate the hyperlink in cell A1, but cannot figure
out how to:

1. Attach the document thats hyperlinked in cell A3
2. Automatically populate the subject line, the body of the e-mail, and the
cc: field.

Ultimately, this macro would run on the €śon open€ť event. Consequently, I
have no idea (or even how to search the discussion groups) how to find all
instances in the worksheet that meet the criteria of Today - 7 days.

Heres what I have so far:

Dim CalDate As Integer

CalDate = 7

If Today - A1 <= CalDate Then

Range("A2").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True

End If

End Sub

Thanks in advance for your help!



All times are GMT +1. The time now is 05:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com