I want to send an email(outlook object) from VBA code.
In the body of that email, I would like to have an Excel work sheet. NOt as an attachement. but the body itself should have the excel file.
how can I do that programmatically do that?
Sub SendEmail()
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = "hello@yahoo.com"
.CC = ""
.BCC = ""
.subject = "This is the Subject line"
.HTMLBody = SheetToHTML(ActiveSheet)
.body = Sheets("DOD Action Plan Email")
.Send
.Display
End With
Application.ScreenUpdating = True
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Help is greatly appreciated.
thanks
In the body of that email, I would like to have an Excel work sheet. NOt as an attachement. but the body itself should have the excel file.
how can I do that programmatically do that?
Sub SendEmail()
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = "hello@yahoo.com"
.CC = ""
.BCC = ""
.subject = "This is the Subject line"
.HTMLBody = SheetToHTML(ActiveSheet)
.body = Sheets("DOD Action Plan Email")
.Send
.Display
End With
Application.ScreenUpdating = True
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Help is greatly appreciated.
thanks