Here is what I was thinking
I would add an additional worksheet that is linked to the client’s info, like name and email address
Name in A1
Email in A2
I would then use A3 for the Subject line of the email and A4 for the body
That way the email can be changed or modified when ever need or just leave as a template.
Then by selecting a send button I would have the option of attaching a file (report) to email before sending, then send.
Here’s what I have so far
Code: Select all
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = Sheets("Sheet1").Range("A2") 'email address
.BCC = ""
.Subject = Sheets("Sheet1").Range("A3")
.Body = Sheets("Sheet1").Range("A4")
'Attach documents here
.Attachments.Add ("C:\Documents and Settings\UserName\My Documents\report.pdf")
.Display 'or use .Display or .Send
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing