VBA Email formatting

floggingmolly

Board Regular
Joined
Sep 14, 2019
Messages
167
Office Version
  1. 365
Platform
  1. 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
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
If your email body text is html or rtf you can wrap your text output with HTML tags.
 
Upvote 0
Worked for me in the past. You could post your attempt? Possible that you didn't concatenate properly.
If posting code, please use code tags (vba button on posting toolbar) to maintain indentation and readability.
 
Upvote 0
Worked for me in the past. You could post your attempt? Possible that you didn't concatenate properly.
If posting code, please use code tags (vba button on posting toolbar) to maintain indentation and readability.
Not sure what you mean about concatenate?
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,196
Members
452,616
Latest member
intern444

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top