Skip to main content

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

Author Siluvia Last modified

In many professional scenarios, simply sending plain text emails from Excel may not be enough to highlight important content or enhance readability. For instance, you might want to emphasize key messages, incorporate headers, or use different colors to organize information for recipients. Applying rich HTML formatting—such as bold, underline, custom font sizes, and colored text—allows you to create visually appealing, easy-to-read emails directly from Excel. This article discusses practical ways to send an email from Excel with a customized HTML-formatted body, including bold, underline, size, and color specifications.

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


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

To send a well-formatted email directly from Excel, you can use a VBA macro that defines the message body using HTML tags. This approach gives you full control over how the email content appears to the recipient, supporting details such as bold, underline, colored, and resized text directly within your email body.

Using VBA to customize and send emails from Excel is especially useful when:

  • You want to generate and send reports, analyses, or reminders from your data with specific highlighted content.
  • You need to maintain a professional, branded appearance in your automated emails.
  • Multiple elements—like titles, headers, or instructions—should stand out for clarity.

However, using VBA for sending emails requires basic knowledge of the VBA editor and Outlook integration, and you should have the necessary Outlook privileges to send emails programmatically.

Below are detailed steps to set up and use the VBA code for this task:

1. Press the Alt + F11 keys simultaneously. This opens the Microsoft Visual Basic for Applications (VBA) editor window, where you can add custom code to automate Excel processes.

2. In the VBA editor window, go to the top menu and click Insert > Module to create a new blank code module. Copy and paste the VBA code provided below into this 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

Parameter and formatting tips:

1) Replace the .Subject part of the code with your own subject line relevant to the message you want to send. Make sure this makes the email easy to identify for the recipient.
2) Input your recipient’s actual email address in the .To field. If sending to multiple people, you can separate addresses with semicolons.
3) The xOutMsg variable is where you write your message body using HTML tags. Here are brief explanations for the main tags that control formatting:
3.1) <b>…</b> – Encloses text you wish to display in bold for drawing attention.
3.2) <span style=""color:#80BFFF"">...</span> – Change the color of specific content. You can modify the hex color code (#80BFFF) to another as needed for stronger emphasis or branding.
3.3) To insert a line break and start a new paragraph or line, use <br/> at the desired location in your text.
3.4) Underline important text with <u>…</u> as needed.
3.5) Set the size of specific content through <p style='font-family:calibri;font-size:25'>…</p>. You can adjust 'font-size:25' to suit your visual requirements. Remember, excessively large or small font sizes may impact readability on different devices.

3. Once you have made the necessary edits, press the F5 key while in the VBA editor to execute the code. Outlook will open a new email with the designated formatting. Review the message, and click the Send button to deliver your customized email.

A screenshot showing an example of sending an email from Excel with HTML text formatting

Precautions and extra tips: Ensure Outlook is open and set up as your default mail client; otherwise, the macro may fail to create or send the message. If you encounter security prompts related to programmatic sending, adjust your Outlook settings accordingly or consult your IT administrator. Always verify recipient emails for accuracy to prevent unintended delivery. Testing the macro by sending an email to yourself can help confirm that your HTML formatting appears as intended across different devices and mail clients.

This VBA approach offers maximum flexibility for HTML styling, but requires Outlook to be installed locally and may require adjusting Outlook macro security settings. For users without Outlook or needing a more user-friendly, click-based process, consider other solutions or add-ins.


Alternative solution: Use Kutools for Excel’s Send Emails utility

If you often need to send formatted emails from Excel but prefer a solution without writing or running VBA code, Kutools for Excel provides a helpful feature: the Send Emails utility. This add-in enables you to send personalized, HTML-formatted messages (including bold, underlined, colored, and sized text) based on data from your Excel worksheet—without dealing with complex code or potential Outlook security prompts.

Easily send email through Outlook based on fields of created mailing list in Excel:

The Send Emails utility of Kutools for Excel helps users sending email through Outlook based on created mailing list in Excel.
Download and try it now!

A screenshot showing the Kutools Send Emails utility in Excel for sending emails

  • This method is recommended if you’re frequently sending similar emails or need to include data from multiple rows dynamically.
  • By using Kutools, you can directly compose HTML-formatted emails through an interactive dialog, preview the effect, and batch send emails with the correct formatting.

Using Kutools reduces the chance of errors compared to code-based methods, is beginner-friendly, and doesn't require enabling or editing macros.

If you experience any error messages (such as “Object variable or With block not set”) while running the VBA solution, ensure your Outlook program is installed and properly configured, your macro settings allow VBA code execution, and all required references are enabled. You may also need to update email addresses and adjust HTML tags for compatibility with your recipient’s email client (some older clients may not support all advanced styles). For bulk sending or high-volume needs, always test with a smaller sample first to avoid triggering spam filters.


Related articles:

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!