Sending emails from excel

Undz12

New Member
Joined
Jun 11, 2017
Messages
10
Hi

I'm a beginner and I've been playing around with sending emails from excel

I'm currently composing the body of the email by just referencing text in a cell in excel
But I'd like some of the text to come out as bold mid sentence, and ideally I'd like this text to be taken from a cell in Excel (so I can easily update the part mid sentence that I want bold)

What is the best solution to this problem please?
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
You would look to use HTMLBody to have the formatting within the body of your email. Have you started any VBA to generate the email yet?
 
Upvote 0
Hi Trevor, thank you for your reply please see below:
The goal is to construct a sentence using 3 cells in excel with one of the cells coming out in bold:

'Essential Code
Dim OutApp As Object
Dim
OutMail As Object
Set
OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)

' Email Body
With OutMail
.HTMLBody = Range("A1").Value & Range("A2").Value & Range("A3").Value
.Display
End With

'Clean Up Code
Set OutMail = Nothing
Set OutApp = Nothing
 
Upvote 0
You're adding text to the .HTMLBody part of the email.

So, since it's html, the way that you would style it to be bold would be to add html bold tags around the text you want bolded.

If I understand correctly, that you want Range("A2").Value to be bolded, you would do something like this.

VBA Code:
.HTMLBody = Range("A1").Value & "<b>" & Range("A2").Value & "</b>" & Range("A3").Value
 
Upvote 0
Solution
To help understand the HTML tags I would recommend you taking a look at W3School as a website. The link to the website is shown below:

 
Upvote 1

Forum statistics

Threads
1,224,824
Messages
6,181,187
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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