How to send email with specified bold/size/color/underline text format in Excel?
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:
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.
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!
- 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:
- How to automatically send email basd on cell value in Excel?
- How to insert signature into Outlook email when sending by vba in Excel?
- How to send email without Outlook in Excel?
- How to send a specific chart in an email with vba in Excel?
- How to send an email at specific time of a day in Excel?
- How to send email with HTML email body in Excel?
Best Office Productivity Tools
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!