Office Settings & Configuration

Set the Font Size in an Outlook HTML Email Using Access VBA

John WilsonJohn Wilson Nov 27, 2026 869 views

Question details

Set a precise font size in an Outlook HTML email generated by Access VBA.

Set the Font Size in an Outlook HTML Email Using Access VBA
Product
Microsoft Access VBA and Microsoft Outlook
Device & OS
not provided
Scenario
An Access VBA procedure creates an Outlook email with an HTML body.
Observed behavior
The email is created, but the requested font size does not display as expected.
Before you start

Open the Access VBA procedure that creates the email and locate the code that assigns the Outlook message's HTMLBody. The Outlook automation example below requires classic Outlook for Windows; new Outlook does not support COM automation.

Solution 1Recommended

Apply an Inline CSS Font Size to the Outlook HTML Body

Use an inline style to specify an exact point size and remove formatting that overrides it.

1
Open the VBA procedure

In Access, press Alt+F11 and open the module containing the procedure that creates the Outlook email.

2
Set the HTML body

Assign HTML with an inline font-size style to the message's HTMLBody. For example, this procedure displays a new message and prepends formatted text to any existing body: Sub CreateEmail() Dim outlookApp As Object Dim mail As Object Set outlookApp = CreateObject("Outlook.Application") Set mail = outlookApp.CreateItem(0) mail.Display mail.HTMLBody = "<div style=""font-family:Arial; font-size:11pt;"">Your text</div>" & mail.HTMLBody End Sub

3
Check conflicting formatting

Inspect the HTML assigned to HTMLBody and remove or update nested font tags and inline styles that specify a different font size. Apply the 11pt style directly to affected elements if they have their own formatting.

4
Test the message

Run the procedure from the VBA editor, review the displayed email, and send a test message to check how the font appears in the recipient's email client.

Apply an Inline CSS Font Size to the Outlook HTML Body
Preserve existing content: The example prepends text to the existing HTMLBody after displaying the message, which can retain an Outlook signature. Assigning a new HTMLBody without appending the existing content replaces it.
Free Microsoft Office alternative

Prepare Formatted Documents with WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for creating and editing documents. Its Microsoft Office format compatibility helps you move existing files into your workflow, though it does not fix Outlook VBA automation.

Apply font sizes and formatting in WPS Writer before sharing document content.Open and edit Microsoft Word DOC and DOCX files.Use a familiar interface to ease migration from Microsoft Office.Work with a free, lightweight office suite.
QA img-9

Frequently Asked Questions

Why doesn't a font tag set an exact 11-point size?

The HTML font size attribute uses a limited set of relative sizes rather than precise point values. Use an inline style such as font-size:11pt on the relevant HTML element instead.

Why is my inline font size still being ignored?

Check the HTMLBody for nested elements with their own font-size styles or font tags. Remove the conflicting formatting or set the intended size directly on those elements.

How do I keep the Outlook signature in my generated email?

Display the message with mail.Display, then prepend your formatted HTML to mail.HTMLBody. Replacing HTMLBody without including its existing content can remove the signature.

Can I run this automation with new Outlook?

The example uses Outlook COM automation, which requires classic Outlook for Windows. New Outlook does not support COM automation.