T
twogoodtwo
Just wondering if somone could help me with some VBA. I have written a
macro so when I press a button, it creates an email with the email
addresses, relevant attachment and text in the body of the email.
However, I also want to add data from one tab called 'stats' (A5:A8 to
be precise) below my first line of the body of the message. Can anybody
help. My exisiting code is below:
Sub Mail_workbook_Outlook()
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
To = "(e-mail address removed)"
CC = ""
BCC = ""
Subject = "Hello"
Dim strbody As String
strbody = "Please find attached today's spreadsheet and
statistics below." & vbNewLine & vbNewLine & _
"Kind regards" & vbNewLine & _
"Me"
Attachments.Add ("C:\desktop\name.pdf")
Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
macro so when I press a button, it creates an email with the email
addresses, relevant attachment and text in the body of the email.
However, I also want to add data from one tab called 'stats' (A5:A8 to
be precise) below my first line of the body of the message. Can anybody
help. My exisiting code is below:
Sub Mail_workbook_Outlook()
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
To = "(e-mail address removed)"
CC = ""
BCC = ""
Subject = "Hello"
Dim strbody As String
strbody = "Please find attached today's spreadsheet and
statistics below." & vbNewLine & vbNewLine & _
"Kind regards" & vbNewLine & _
"Me"
Attachments.Add ("C:\desktop\name.pdf")
Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub