meiteniite89
New member
- Local time
- Today, 14:51
- Joined
- Aug 13, 2020
- Messages
- 23
Hello,
I have generated report from form and I need it to be dent in the body of the email.
Is it possible?
I have read loads of threads and put together this, see below.
Currently it sends an attachment from my computer, but not report. I know there is a lot wrong, but I just figure it out.
I have generated report from form and I need it to be dent in the body of the email.
Is it possible?
I have read loads of threads and put together this, see below.
Currently it sends an attachment from my computer, but not report. I know there is a lot wrong, but I just figure it out.
Code:
Dim olApp As Outlook.Application
Dim olMail As Outlook.MailItem
'get application
On Error Resume Next
Set olApp = GetObject(, "Outlook.Application")
If olApp Is Nothing Then Set olApp = New Outlook.Application
On Error GoTo 0
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.Subject = "My email with attachment"
.Recipients.Add "carl.sutcliffe@cummins.com"
.Attachments.Add "C:\Users\jy871\Desktop\front page.xlsm"
.Body = "Here is an email"