Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or
0
0
0
s2smodern

How to send email with specified bold/size/color/underline text format in Excel?

HTML body format can enrich the email and make it easy to read. This article is talking about sending an email with HTML format email body in Excel by adding bold, underline as well as specified size and color text format.

Send email with specified bold/size/color/underline text format with VBA code


Easily send email through Outlook based on created mailing list:

The Send Emails utility of Kutools for Excel helps users sending email through Outlook based on created mailing list in Excel. See screen shot:

Kutools for Excel includes more than 120 handy Excel tools. Free to try with no limitation in 60 days. Download the free trial now


Send email with specified bold/size/color/underline text format with VBA code


Please apply below VBA code to send an email with specific HTML body format in Excel.

1. Press the Alt + F11 keys simultaneously to open the Microsoft Visual Basic for Applications window.

2. In the Microsoft Visual Basic for Applications window, click Insert > Module. Then copy below VBA code into the Code window.

VBA code: Send email with specific bold/size/color/underline text format in Excel

Sub SharePerformance1()
'Update by ExtendOffice 2018/3//5
    Dim xOutApp As Object
    Dim xOutMail As Object
    Dim xOutMsg As String
    On Error Resume Next
    Set xOutApp = CreateObject("Outlook.Application")
    Set xOutMail = xOutApp.CreateItem(0)
    xOutMsg = "<b>This text is bold</b><br/><span style=""color:#80BFFF"">Font Color</span style=""color:#80BFFF""><br />" & _
               "<u>New line with underline</u><br /><p style='font-family:calibri;font-size:25'>Font size</p>"
    With xOutMail
        .To = "Email Address"
        .CC = ""
        .BCC = ""
        .Subject = "Html format email"
        .HTMLBody = xOutMsg
        .Display
    End With
    Set xOutMail = Nothing
    Set xOutApp = Nothing
End Sub

Notes:

1) Replace the .Subject line with your own one.

2) Enter the recipient’s email address into the .To line.

2) In the xOutMsg line:

2.1) <b>…</b> can make your text bold;

2.2) <span style=""color:#80BFFF"">...</span style=""color:#80BFFF""> is the text color

2.3) If you want to restart a new line, please add <br/> before the new line text;

2.4) Underline your text with <u>…</u>;

2.5) And change your text size by <p style='font-family:calibri;font-size:25'>…</p>.

3. Press the F5 key to run the code. Then email with specified HTML format body is opening. Please click the Send button to send it.


Related articles:


Recommended Productivity Tools

Office Tab

gold star1 Bring handy tabs to Excel and other Office software, just like Chrome, Firefox and new Internet Explorer.

Kutools for Excel

gold star1 Amazing! Increase your productivity in 5 minutes. Don't need any special skills, save two hours every day!

gold star1 200 New Features for Excel, Make Excel Much Easy and Powerful:

  • Merge Cell/Rows/Columns without Losing Data.
  • Combine and Consolidate Multiple Sheets and Workbooks.
  • Compare Ranges, Copy Multiple Ranges, Convert Text to Date, Unit and Currency Conversion.
  • Count by Colors, Paging Subtotals, Advanced Sort and Super Filter,
  • More Select/Insert/Delete/Text/Format/Link/Comment/Workbooks/Worksheets Tools...

Screen shot of Kutools for Excel

btn read more      btn download     btn purchase

Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.

Be the first to comment.