How to Reply to an Outlook Message using Access VBA
Question details
The user needs to open a saved Outlook message via an Access form hyperlink and generate a reply with additional text using VBA, rather than creating a brand new email.

- Product
- Microsoft Access and Outlook
- Device & OS
- not provided
- Scenario
- Automating email replies from a Microsoft Access database by interacting with saved Outlook message files via VBA.
- Observed behavior
- Using the CreateItemFromTemplate method creates a completely new message instead of properly formatting the email as a reply to the original saved message.
Ensure that Microsoft Outlook is installed on the same computer as your Access database and that the Microsoft Outlook Object Library reference is enabled in your Access VBA editor.
Use the MailItem.Reply Method in VBA
Instead of using CreateItemFromTemplate, you should open the saved email as a shared item and use the native Reply method to retain the conversation history.
The CreateItemFromTemplate function is designed to generate a brand new email based on an .oft or .msg file format. Because it strips away conversation context, it cannot be used to generate a reply. To properly reply to an existing saved message, you must open the item using the Outlook Namespace session and invoke the .Reply method.
Open the VBA Editor in Access by pressing Alt + F11. Navigate to Tools > References, scroll down, and check 'Microsoft Outlook Object Library' to ensure your code can interact with Outlook.
Use the Outlook Namespace to open the saved .msg file from your hyperlink path. Example: Set olItem = olApp.Session.OpenSharedItem("C:\Path\To\Your\Message.msg").
Create a new variable for the response and call the built-in reply function on the opened item: Set olReply = olItem.Reply.
Append your additional text to the body of the reply before the original message thread. Example: olReply.HTMLBody = "Your new text here<br>" & olReply.HTMLBody. Finally, use olReply.Display to show the drafted reply to the user.

Looking for a Lightweight Alternative to Microsoft Office?
While cross-application VBA automation between Microsoft Access and Outlook requires a Microsoft Office environment, WPS Office offers a powerful, free, and lightweight alternative for your standard document processing, spreadsheet data analysis, and presentation needs. Experience familiar interfaces and seamless file compatibility without the heavy subscription fees.
- 1. Download the WPS Office installer: Visit the official WPS Office website and click the free download button for your specific operating system.
- 2. Install the application: Run the downloaded installer and follow the simple on-screen instructions to set up the suite on your device.
- 3. Open and edit your files: Launch WPS Office to immediately start opening, editing, and saving your existing Microsoft Office documents seamlessly.

Frequently Asked Questions
Why does CreateItemFromTemplate create a new email instead of a reply?
The CreateItemFromTemplate method is specifically designed to use an existing file (.oft or .msg) as a blank structural template for a completely new email draft. It intentionally strips out conversation metadata, making it impossible to act as a direct reply.
Can I use ReplyAll instead of Reply in my VBA script?
Yes. If you need the generated response to go to all original recipients and CCs, simply replace the olItem.Reply method with olItem.ReplyAll in your VBA code.
What happens if the hyperlink path to the saved message is broken?
If the OpenSharedItem method cannot find the .msg file at the provided hyperlink path, the VBA script will throw a runtime error. It is highly recommended to include an error-handling block (On Error GoTo) in your Access VBA to alert the user if the file is missing.




