ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Formating Body When Sending Mail (https://www.excelbanter.com/excel-programming/331817-formating-body-when-sending-mail.html)

Andrew

Formating Body When Sending Mail
 
Hi,

How do I format the body of an email. I want it to be bold, font size 12
and font to be Arial. See my code to date.

Sub SendMail()
'You must add a reference to the Microsoft outlook Library
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olmailitem)
With OutMail
.To = To_List
.CC = CC_List
.BCC = ""
.Subject = The_Subject
.Attachments.Add ActiveWorkbook.FullName
.Body = Line1 & Chr(13) & Chr(13) & Line2 & Chr(13) & Chr(13) &
Line3 & Chr(13) & Chr(13) & Line4
.Send
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub



--
Andrew

keepITcool

Formating Body When Sending Mail
 

the body property excepts plain text only.
for formatted text you must use the HTMLbody
and write a string with html tags to it..





--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Andrew wrote :

Hi,

How do I format the body of an email. I want it to be bold, font
size 12 and font to be Arial. See my code to date.

Sub SendMail()
'You must add a reference to the Microsoft outlook Library
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olmailitem)
With OutMail
.To = To_List
.CC = CC_List
.BCC = ""
.Subject = The_Subject
.Attachments.Add ActiveWorkbook.FullName
.Body = Line1 & Chr(13) & Chr(13) & Line2 & Chr(13) & Chr(13)
& Line3 & Chr(13) & Chr(13) & Line4
.Send
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub



All times are GMT +1. The time now is 02:35 AM.

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