ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   E-mailing (https://www.excelbanter.com/excel-programming/390290-e-mailing.html)

CV323

E-mailing
 
Below is my code. Everything works fine except that the e-mail message does
not show up in the body of the e-mail. Why?


'EMAIL ALTIMONTE
Application.DisplayAlerts = False
If OptionAltimonte = True And OptionEmail = True Then
Workbooks.Open ( _
"W:\compensa\2007 Reports\Master Turnover.xls") _
, UpdateLinks:=0
Dim OutApp As Object
Dim OutMail As Object
strbody As String
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
ActiveWorkbook.SendMail ", Subject:="May
Turnover Report", ReturnReceipt:=True
'===========================
'THIS SHOULD BE THE BODY OF THE EMAIL MESSAGE
Msg = "Hi there" & vbNewLine & vbNewLine & _
Msg = Msg & "Attached is the May Turnover Report"

Windows("Master Turnover.xls").Close savechanges = False
Application.DisplayAlerts = True
End If

JLGWhiz

E-mailing
 
You didn't tell it to put the msg in the body. See Ron's site:

http://www.rondebruin.nl/sendmail.htm

"CV323" wrote:

Below is my code. Everything works fine except that the e-mail message does
not show up in the body of the e-mail. Why?


'EMAIL ALTIMONTE
Application.DisplayAlerts = False
If OptionAltimonte = True And OptionEmail = True Then
Workbooks.Open ( _
"W:\compensa\2007 Reports\Master Turnover.xls") _
, UpdateLinks:=0
Dim OutApp As Object
Dim OutMail As Object
strbody As String
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
ActiveWorkbook.SendMail ", Subject:="May
Turnover Report", ReturnReceipt:=True
'===========================
'THIS SHOULD BE THE BODY OF THE EMAIL MESSAGE
Msg = "Hi there" & vbNewLine & vbNewLine & _
Msg = Msg & "Attached is the May Turnover Report"

Windows("Master Turnover.xls").Close savechanges = False
Application.DisplayAlerts = True
End If



All times are GMT +1. The time now is 06:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com