lopiteaux
Board Regular
- Joined
- Jun 8, 2011
- Messages
- 77
Hi all,
I've got a little bit of code in place that creates an email from Excel. It's fairly basic, and I'd like to add the following three functions to it:
1) Add the current workbook as an attachment,
or (these do not necessarily need to work on the same message)
2) Add a predefined range as the MESSAGE BODY (i.e. File > Send To > Mail Recipient > Send the current sheet as the message body)
3) Add the signature stored in Outlook
4) Send it off.
This is the code I have sofar - as I said, real basic.
Appreciate any help, thanks!
lopiteaux
I've got a little bit of code in place that creates an email from Excel. It's fairly basic, and I'd like to add the following three functions to it:
1) Add the current workbook as an attachment,
or (these do not necessarily need to work on the same message)
2) Add a predefined range as the MESSAGE BODY (i.e. File > Send To > Mail Recipient > Send the current sheet as the message body)
3) Add the signature stored in Outlook
4) Send it off.
This is the code I have sofar - as I said, real basic.
Code:
Sub SendEmail()
Dim OutlookApp As Object, mail As Object
Dim msgbody As String
Set OutlookApp = CreateObject("Outlook.Application")
msgbody = "Please find attached today's report." & vbCrLf & vbCrLf
msgbody = msgbody & "Kind regards," & vbCrLf & vbCrLf
Set mail = OutlookApp.CreateItem(0)
With mail
.SentOnBehalfOfName = "SENDER"
.To = "RECIPIENT"
.CC = "CCRECIPIENT"
.Subject = "Report for COB " & Format(Date - 1, "dd/mm/yyyy")
.body = msgbody
.display
End With
End Sub
Appreciate any help, thanks!
lopiteaux