Solved

VBA script for Access to outlook email

Posted on 2014-10-22
4
224 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
ID: 40396995
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
ID: 40397574
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
ID: 40410780
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
ID: 40619306
Thanks for the help!
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have a large data set and a SSIS package. How can I load this file in multi threading?
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

856 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