How to Email Microsoft Access Form Data as Text Using Outlook
Question details
The user wants to extract specific data from an active Microsoft Access form and send it as plain text directly within the body of an email, rather than as an attached file.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Automating the process of sharing database record details with colleagues or clients via email directly from a form interface.
- Observed behavior
- Using the default DoCmd.SendObject method creates an email but forces the Access object to be sent as an attachment, failing to insert the form's control values into the message body.
Ensure that Microsoft Outlook is installed, configured with an active email profile, and that you have enabled macros in your Microsoft Access Trust Center settings to allow VBA code execution.
Use VBA to Construct an Outlook Email with Form Data
Since SendObject is designed for attachments, writing a customized VBA script allows you to open an Outlook message and map specific Access form fields directly into the email body.
By leveraging the Microsoft Outlook Object Library, you can programmatically read the values of your form text boxes, combo boxes, or labels, concatenate them into a structured text string, and assign them to the body property of a new mail item.
In your Microsoft Access database, open the form you want to use in Design View. Select the button you want to trigger the email, open the Property Sheet, go to the 'Event' tab, and click the ellipsis (...) next to 'On Click' to open the VBA editor.
In the VBA Editor menu, click 'Tools' > 'References'. Scroll down the list, check the box for 'Microsoft Outlook XX.X Object Library' (where XX.X is your version number), and click 'OK'.
Declare your Outlook application and mail item variables. Use code similar to: `Dim olApp As Outlook.Application`, `Dim olMail As Outlook.MailItem`, and `Set olApp = CreateObject("Outlook.Application")`.
Create the new email with `Set olMail = olApp.CreateItem(olMailItem)`. Define the message body by pulling data from your form controls, for example: `olMail.Body = "Customer Name: " & Me.txtCustomerName.Value & vbCrLf & "Order Details: " & Me.txtOrderDetails.Value`.
Add `olMail.Display` at the end of your script to open the Outlook window so you can review the drafted text before sending. If you want it to send automatically in the background, use `olMail.Send` instead.

Looking for a Lightweight, Free Office Suite?
While complex relational databases require specialized software like Microsoft Access, your everyday productivity tasks—such as creating documents, spreadsheets, and presentations—can be easily handled by WPS Office. It provides a highly compatible, cost-effective alternative to Microsoft Office.
- 1. Download the Installer: Visit the official WPS Office website and click the free download button for your operating system.
- 2. Install the Software: Run the downloaded installation file and follow the quick on-screen instructions to set up the suite.
- 3. Open Your Existing Files: Launch WPS Office and directly open your existing Word, Excel, or PowerPoint files with perfect formatting retention.

Frequently Asked Questions
Why does DoCmd.SendObject force an attachment?
The DoCmd.SendObject macro action was specifically built to export entire Access objects (like reports, tables, or queries) into formats like Excel or PDF and attach them to an email. It was not designed to parse individual user interface elements into plain body text.
Can I format the extracted form data using HTML?
Yes. When writing your Outlook VBA script, assign your concatenated string to the `.HTMLBody` property instead of the `.Body` property. This allows you to use standard HTML tags like <br> for line breaks or <b> for bold text to format your Access form data neatly.
What is the Immediate window mentioned in Access VBA?
The Immediate window is a debugging tool inside the Access VBA Editor (accessible by pressing Ctrl+G). Developers use it to test small snippets of code or print variable values (like form data) in real-time without having to run the entire macro.




