Insert PDF Content into Outlook Email Body via Access VBA
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.
Ensure you have enabled the Microsoft Outlook Object Library reference in your Access VBA editor (Tools > References) to utilize Outlook automation features.
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.
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.
Write a VBA function to open the extracted text or HTML file and read its contents into a string variable.
Create your Outlook MailItem object via VBA and assign the populated string variable to the `.HTMLBody` or `.Body` property of the email message.
Attach the PDF File and Send via Access VBA
If preserving the original PDF formatting is strictly required, attaching the document while adding a reference in the email body is the standard approach.
Convert PDF Pages to Images for Inline Embedding
Convert the PDF into image files and embed them within the HTML body of the email.
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.

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.




