Solved

VBA script for Access to outlook email

Posted on 2014-10-22
4
219 Views
Last Modified: 2016-02-10
I am using Access as a front end for an SQL express database.  I am searching for a VBA script that will allow me to send an email which will populate from three fields - two email fields (student and instructor) which I will send the email to, and one larger field which will contain a section of notes about what was discussed during an appointment  (body of email or an attachment - either works).
0
Comment
Question by:mjburgard
  • 2
4 Comments
 
LVL 12

Assisted Solution

by:James Elliott
James Elliott earned 250 total points
Comment Utility
This will get you started with using an Outlook object in VBA.

Including information from a recordset should be fairly simple from here.

http://msdn.microsoft.com/en-us/library/office/ff197046(v=office.15).aspx
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 250 total points
Comment Utility
If you have no need of automating Outlook, then you can use SendObject:

Dim sBody as String
Dim rst As DAO.Recordset
Set rst = Currentdb.OpenRecordset("SELECT * FROM YourTable")

DoCmd.SendObject acSendNoObject, , , rst("EmailTo"), , , "Your Subject", rst("BodyField")

Or, if needed, you can automate Outlook. Here's an EE article:

http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/A_4316-Automate-Outlook-in-VBA-with-the-OutlookCreateItem-Class.html
0
 
LVL 1

Author Comment

by:mjburgard
Comment Utility
I have glanced at both of those and will be looking at them in more depth later this week - Both of the above appear to be very helpful and what I am looking for.
0
 
LVL 1

Author Closing Comment

by:mjburgard
Comment Utility
Thanks for the help!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Modern/Metro styled message box and input box that directly can replace MsgBox() and InputBox()in Microsoft Access 2013 and later. Also included is a preconfigured error box to be used in error handling.
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now