Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
  1. #16
    AJM229 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2014
    Posts
    10

    I should probably revise my prior post... something does occur when I push my command button. Outlook seems to spool up (the icon in the lower right appears and when I hover over it it says that another program is using Outlook), but no new email window appears with the To: and Subject: fields filled in like I want. I think I'm pretty close here, but I'm just not sure where my issue is.

  2. #17
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Maybe adding a .Body property and a .Send method will do the trick. Also, if Outlook is not running, I do not believe the message will be sent. The exception to that is if you adjust settings within Outlook to interact with your app.

    Here is a snippit using Late binding and HTML body format.
    Code:
    Dim appOutLook As Object
    Dim MailOutLook As Object
    Set appOutLook = CreateObject("Outlook.Application")
    Set MailOutLook = appOutLook.CreateItem(0)
    With MailOutLook
        .BodyFormat = 2
        .To = "MyEmail@Domain.com"
        ''.cc = ""
        ''.bcc = ""
        .Subject = "Subject Line"
        .HTMLBody = "This is the body of the Email" ' & Me.ControlName.Value
        .DeleteAfterSubmit = False 'This would let Outlook send the note without storing it in your sent bin
        .ReadReceiptRequested = False 'Request a read receipt from the recipient
        .Send
        
    End With
    I think default body format is text. So you should be able to do something like this too

    Code:
    With MailOutLook
    
        .To = "MyEmail@Domain.com"
        .Subject = "Subject Line"
        .Body = "This is the body of the Email" 
        .Send
        
    End With

  3. #18
    AJM229 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2014
    Posts
    10
    I decided to try to go about this a different way. The whole reason I tried doing this was because I couldn't get the email address from the table to display as clickable in the field on my form. When someone selects a rep name from the combo box, it populates the "Email Address" field of my form automatically. However, because the email address is a hyperlink in the table, it displays as "<email address>#mailto:<email address>#"

    Any way to just get the thing to show up as a clickable hyperlink in the form?

  4. #19
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I think the fact that your email address is a hyperlink in the table is why you are having so much trouble. I always store the literal text of the Email address in my tables. If you want to try creating a hyperlink that uses the machines default email program......

    The HTML looks like this
    <a href="mailto:YourName@YourSite.com">YourName@YourS ite.com</a>

    In a click event of a control that has a Hyperlink property, the VBA would probably look like this....

    Code:
    Me.ControlName.HyperlinkAddress  = "mailto:YourName@YourSite.com"

  5. #20
    burrina's Avatar
    burrina is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    Here is a typical example:


    Dim strToWhom As String
    Dim strMsgBody As String
    Dim strSubject As String
    Dim strBcc As String
    Dim strrptName As String
    Dim strextension As String

    strToWhom = Me.EmailTo 'Your Email To Field Name.
    strSubject = Me.EmailSubject 'Your Email Subject Field Name.
    strBcc = Me.cbobcc 'Your Bcc Field Name.
    strMsgBody = Me.EmailMessage 'Your Email Body Field Name.

    DoCmd.SendObject , , , strToWhom, , strBcc, strSubject, strMsgBody, True

    HTH

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. send outlook email with late binding
    By markjkubicki in forum Programming
    Replies: 3
    Last Post: 01-24-2014, 09:39 AM
  2. Replies: 9
    Last Post: 11-27-2013, 11:08 AM
  3. Replies: 5
    Last Post: 04-25-2013, 10:36 AM
  4. Send email in Outlook with attachment
    By kelkan in forum Programming
    Replies: 1
    Last Post: 02-01-2013, 10:31 PM
  5. Send email from Access thru Outlook
    By ZMAN in forum Forms
    Replies: 2
    Last Post: 11-27-2010, 06:10 PM

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