Results 1 to 5 of 5
  1. #1
    IncidentalProgrammer is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2014
    Location
    Texas
    Posts
    156

    Sending Outlook Emails from form in Access 2007

    Hi, all!



    I've looked online, and can't find a good answer for this; I'm getting results for other versions of Access, people lamenting changes made in 2007 that make this more difficult, things that are doing way more than I need, and a Microsoft article that refers you to its now MIA sample download. I figured someone here would know for sure.

    I'm trying to implement some fairly simple email options into my Access 2007 database project. The first is to have a button set next to an email field in my contacts form, which when pressed will read that email address, and open up a new email in Outlook made out to that address. This is the first time I'm trying to have Access communicate with another program though, and I'm at a loss as to how to make that happen.

    The one more sophisticated thing I'm trying to do in another form is where I may have multiple people who need to go on an email, and some information I want to auto-fill in parts of the email. In this scenario, there are 3 different types of entities which may need to be contacted, and potentially multiple people per entity. I'm putting in the ability to flag certain contacts as needing to be on ALL emails, but how would I then get all of their email addresses to go automatically to the email being sent? I also need to be able to add other contacts to it from the available list, as needed. Is there also a way to take data from a field that would identify the item the email is about, and send that to the new email's signature?

    Does anyone know of any good articles or other resources online that might deal with these sorts of needs?

  2. #2
    IncidentalProgrammer is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2014
    Location
    Texas
    Posts
    156
    Actually just got the first one (simple email from button) working. So now I just have to figure out multiple contacts in an email.

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    Generally speaking you would need some way of identifying the desired contacts, use SQL to open a recordset on those contacts, and loop the recordset building a string: "Address1; Address2; Address3". More on loops here, though it's a bit cluttered:

    http://www.granite.ab.ca/access/email/recordsetloop.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    IncidentalProgrammer is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2014
    Location
    Texas
    Posts
    156
    Thanks, pbaldy! I haven't used loops yet, so that should be a big help.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    No problem, post back if you get stuck.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Sending Emails from Access via Outlook
    By Terry Lawson in forum Programming
    Replies: 3
    Last Post: 11-14-2014, 10:03 AM
  2. Sending several emails causes Outlook crash
    By mercapto in forum Programming
    Replies: 3
    Last Post: 06-14-2013, 07:30 AM
  3. Generating and sending emails through Access
    By crowegreg in forum Programming
    Replies: 9
    Last Post: 06-10-2013, 08:35 AM
  4. Replies: 8
    Last Post: 03-12-2013, 11:49 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums