Set the Font Size in an Outlook HTML Email Using Access VBA
Question details
Set a precise font size in an Outlook HTML email generated by 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.
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.
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.
In Access, press Alt+F11 and open the module containing the procedure that creates the Outlook email.
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
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.
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.

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.

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.




