Results 1 to 4 of 4
  1. #1
    michaeljohnh is offline More Human than Human
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    61

    Selecting a template to email using Access 2007

    I am using a form to select an email address and Outlook template to email. I am able to get the new email to open in Outlook with the proper address without a problem (found the code in another post here). I cant seem to figure out how to adjust the code to use a pre-existing Outlook email template. The control Im using is cboTemplate. Here is the code:


    On Error GoTo Err_Command39_Click
    Dim stDocName As String
    stDocName = "Empty_Report"
    ' DoCmd.SendObject acReport, stDocName
    DoCmd.SendObject acSendNoObject, stDocName, acFormatXLS, Me.email_recipient, , , "Test Email", , True
    Exit_Command39_Click:
    Exit Sub


    Err_Command39_Click:
    MsgBox Err.Description
    Resume Exit_Command39_Click


    One final note, I am required to use Outlook.
    Thanks in advance!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Though I haven't used it, the final argument of SendObject is for a template. From help:

    A string expression that's the full name, including the path, of the file you want to use as a template for an HTML file.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    michaeljohnh is offline More Human than Human
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    61
    I gave that a try and though it didnt generate an error, it also didnt seem to have any affect on the email. I put the entire path and file name in quotes at the end. Im wondering if maybe the .oft format isnt supported. Im heading home now, Ill try different formats tommorrow. If someone can make a working example and post it that would be great.

  4. #4
    michaeljohnh is offline More Human than Human
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    61
    Well I tried using a .txt file with the typical html tags as well at an .htm file and neither work. I suspect the functionality of that argument is different than what I am looking for. Or the formatting of the body of the file is extremely particular.

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

Similar Threads

  1. How can I send an email from access???
    By Asma in forum Programming
    Replies: 2
    Last Post: 12-07-2011, 07:49 AM
  2. MS Access Template Question
    By DreamOn in forum Access
    Replies: 1
    Last Post: 06-24-2010, 09:20 AM
  3. **Please Help** Email Excel From Access
    By graviz in forum Programming
    Replies: 6
    Last Post: 05-10-2010, 01:43 PM
  4. Replies: 0
    Last Post: 11-17-2009, 02:35 PM
  5. Help with Selecting a single record in access.
    By rfhall50 in forum Programming
    Replies: 3
    Last Post: 08-10-2009, 08:50 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