Solved

VBA script for Access to outlook email

Posted on 2014-10-22
4
225 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Use Windows Task Scheduler to print a Word document weekly so your printer ink won't dry out.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

696 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