floggingmolly
Board Regular
- Joined
- Sep 14, 2019
- Messages
- 167
- Office Version
- 365
- Platform
- Windows
I have a code that sends emails from my workbook. I would like to be able to format the text. Can anyone assist me with this? Below is the code I am using but I'm not sure how to adjust it so I can format the text. Any help would be appreciated.
Code:
Option Explicit
Sub CreateCourseCertificates()
Dim EApp As Object
Set EApp = CreateObject("Outlook.Application")
Dim EItem As Object
'Dim EApp As Outlook.Application
'Set EApp = New Outlook.Application
'Dim EItem As Outlook.MailItem
'Set EItem = EApp.CreateItem(olMailItem)
Dim RList As Range
Set RList = Range("A2", Range("a2").End(xlDown))
Dim R As Range
For Each R In RList
Set EItem = EApp.CreateItem(0)
With EItem
.To = R.Offset(0, 4)
.cc = R.Offset(0, 6)
.Subject = "Medals - Areas of Improvement for " & R.Offset(0, 1)
.Body = "Dear " & R.Offset(0, 5) & vbNewLine & vbNewLine _
& "In the medals process, the areas of improvement are " & R.Offset(0, 3) & vbNewLine _
& vbNewLine & vbNewLine & "Many thanks" & vbNewLine & vbNewLine & _
"Ron B."
.Display
End With
Next R
Set EApp = Nothing
Set EItem = Nothing
End Sub