Solved

VBA script for Access to outlook email

Posted on 2014-10-22
4
222 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL multicriteria from ONE textbox 32 43
Create snapshot on MSSQL 2012 3 18
Sql Query 6 65
How best to represent data in Excel? 13 25
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

770 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