I am in process of creating a macro that will save the current workbook, create a new outlook message and attach the file to the message. My macro does that but I can not format the text in the body of the email to my liking.
Dim OutApp As Object
Dim OutMail As Object
Dim sBody, Customer As String
ActiveWorkbook.Save
sBody = "All," & Chr(10) & Chr(10) & "Please Approve attached Request below for " & rType & "." _
& Chr(10) & Chr(10) & "Customer: " & customer & Chr(10)
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.to = recip
.CC = CCed
.BCC = ""
.subject = subject
.Body = sBody
.Attachments.Add ActiveWorkbook.FullName
.display
End With
On Error GoTo 0
End Sub
I want the following message to be displayed (with the format) in the email.
All,
Please Approve attached Request below for "rtype".
Customer: Stackoverflow
So, the word "customer" needs to be bold. I have tired multiple solutions but they do not work as this is creating an outlook mail object.
Any Help will be appreciated.
**
Solution: To make the HTML tags work change the body type to html by ".HTMLBody". and you will be able to use HTML Tags. Kudos to Dick Kusleika
**