Attachment Issues

Insert PDF Content into Outlook Email Body via Access VBA

Steven ParkerSteven Parker Oct 29, 2026 868 views

Question details

The user wants to insert or embed the contents of a PDF directly into the body of an Outlook email using Access VBA.

Product
Microsoft Access / Microsoft Outlook
Device & OS
not provided
Scenario
Automating email generation in Access VBA where PDF content needs to be displayed inline in the email body rather than as a standard attachment.
Observed behavior
Outlook email bodies natively support plain text or HTML, preventing the direct embedding or rendering of an entire PDF document within the message body.
Before you start

Ensure you have enabled the Microsoft Outlook Object Library reference in your Access VBA editor (Tools > References) to utilize Outlook automation features.

Solution 1Recommended

Convert PDF Content to HTML or Text for Inline Display

Since email bodies do not support native PDF rendering, extracting the text or converting it to HTML is the most reliable way to display the content inline.

Microsoft Outlook email bodies are formatted using plain text, RTF, or HTML. They cannot natively parse and render a standalone PDF file directly inside the body.

To display the information from a PDF inline, you must first extract its text or convert the document pages into an HTML format.

1
Extract PDF Content

Use a third-party PDF library or a command-line conversion tool in your VBA script to extract the text or convert the PDF pages into an HTML file.

2
Read the Converted File via VBA

Write a VBA function to open the extracted text or HTML file and read its contents into a string variable.

3
Assign Content to HTMLBody

Create your Outlook MailItem object via VBA and assign the populated string variable to the `.HTMLBody` or `.Body` property of the email message.

Formatting Limitations: Complex PDF formatting and embedded images may not transfer perfectly when converting to standard HTML for email bodies.
Free Microsoft Office alternative

Discover WPS Office for Seamless Document and PDF Management

While automating Microsoft Outlook and Access requires complex VBA scripting, WPS Office provides an integrated, lightweight suite with powerful built-in PDF tools. Edit, convert, and manage PDFs effortlessly without writing complex code.

Fully compatible with Microsoft Office formats (.docx, .xlsx, .pptx).Built-in robust PDF toolkit for easy conversion between PDF, Word, Excel, and image formats.Lightweight application that requires minimal system resources.Familiar and intuitive tabbed user interface.Completely free to download and use for essential office tasks.
microsoft office alternative - wps office

Frequently Asked Questions

Can I embed a PDF as an image in an Outlook email body using VBA?

Yes, you can convert the PDF pages into image formats (like JPG or PNG) using a conversion tool, and then embed those images inline using the `.HTMLBody` property and the `cid:` tag referencing the attached image.

Why does the SendObject command fail when sending HTML emails in Access?

The `DoCmd.SendObject` macro in Access is limited to plain text message bodies. To send HTML emails or manipulate complex objects, you must use Outlook automation via the Outlook Object Model (`Outlook.Application`).

Is it possible to embed a fully interactive PDF in an email?

No, major email clients, including Microsoft Outlook, block interactive elements and scripts for security reasons. The email body only natively supports plain text, RTF, or static HTML.