J
jamesdeckert
When I send an HTML e-mail, I must display the message, for the body to be
placed in the email. If I comment out the .display, the body of the email is
blank. I'd prefer not to display the message.
below is my code.
Dim objOutlook As Outlook.Application
Dim objMsg As Outlook.MailItem
Set objOutlook = CreateObject("Outlook.Application")
Set objMsg = objOutlook.CreateItem(olMailItem)
strBody = Replace(strBody, vbCrLf, "<br>")
With objMsg
.To = strRecipient
.Subject = strSubject
.BodyFormat = olFormatHTML
.HTMLBody = strBody
.Display ' body only appears if I Display first. Don't know why.
.Send
End With
Set objOutlook = Nothing
Set objMsg = Nothing
The ".BodyFormat = olFormatHTML" doesn't seem to make a difference whether
it is there or not.
Any ideas?
James
placed in the email. If I comment out the .display, the body of the email is
blank. I'd prefer not to display the message.
below is my code.
Dim objOutlook As Outlook.Application
Dim objMsg As Outlook.MailItem
Set objOutlook = CreateObject("Outlook.Application")
Set objMsg = objOutlook.CreateItem(olMailItem)
strBody = Replace(strBody, vbCrLf, "<br>")
With objMsg
.To = strRecipient
.Subject = strSubject
.BodyFormat = olFormatHTML
.HTMLBody = strBody
.Display ' body only appears if I Display first. Don't know why.
.Send
End With
Set objOutlook = Nothing
Set objMsg = Nothing
The ".BodyFormat = olFormatHTML" doesn't seem to make a difference whether
it is there or not.
Any ideas?
James