Results 1 to 2 of 2
  1. #1
    chuchothelord is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2014
    Posts
    1

    Question Email button on a form launching outlook

    I want to create a button on a form that will launch a new Outlook EMAIL using data from the current record.

    1) I want to leave the "TO" field blank in outlook to be filled in by the user.
    2) My database is basically a package log with simple fields... Package For, Package From, Date Received, Shipped Via and tracking number.
    3) I want the Subject line to equal the "Package From" Field.
    4) I want the body to be something like this... A package arrived for you on "Date Received" from "Package From". It was delivered by "Shipped Via" and the tracking number is "Tracking Number". Please pick up your package as soon as possible.



    If this is possible, please let me know.

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Here is one approach

    Code:
    Dim strSubject As String
    Dim strBody As String
    Dim strReport As String
    Dim strTo As String
    Dim strCc As String
    Dim strBcc As String
    strSubject = "Insert Subject Line Here"
    strBody = "Insert text to be displayed in the email body"
    strReport = "rptEquip"
    strTo = "you@gmail.com"
    strCc = ""
    strBcc = "me@gmail.com"
    DoCmd.SendObject acSendReport, strReport, acFormatTXT, strTo, strCc, strBcc, strSubject, strBody, False
    The very last word in the example is False. This parameter is supposed to either send the email without the user reviewing it or open the object so the user can edit it and send it at their will. I can't remember if you want False or True. Having said that, some people complain that the parameter at the end (True or False) is ignored by some version of Outlook.

    If you have to, you could try another method. One might be to create a Macro using the Email option within the Ribbon.

    Another method is to instantiate an Outlook Object and automating. This requires a little more VBA.

    Maybe something like this
    https://www.accessforums.net/forms/c...tml#post225174

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

Similar Threads

  1. Replies: 5
    Last Post: 05-07-2014, 09:25 AM
  2. Command Button to Send Outlook Email
    By AJM229 in forum Forms
    Replies: 19
    Last Post: 05-07-2014, 09:05 AM
  3. Replies: 1
    Last Post: 12-10-2013, 12:59 AM
  4. Email to outlook based off fields in a form
    By jcbrackett in forum Programming
    Replies: 4
    Last Post: 03-07-2012, 11:41 AM
  5. email button in form
    By peterinbristol in forum Forms
    Replies: 0
    Last Post: 03-19-2007, 02:25 PM

Tags for this Thread

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