Setting From criteria when automating outlook from Access 03

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • evilbungle
    New Member
    • Apr 2008
    • 26

    Setting From criteria when automating outlook from Access 03

    Hi,

    I have a form that automates an outlook e-mail, I can get the e-mail to send fine but now I need to try and change who the e-mail is from. (I have a group mailbox which I need the e-mail to go from rather than an individual.)

    Is there a keyword for the from line in an outlook mail?

    Here is the code I am using with my effort to guess it.

    Code:
     Set myOutlook = CreateObject("Outlook.Application")
    
    Set myMailItem = myOutlook.CreateItem(0)
    Set myAttachments = myMailItem.Attachments
    With myMailItem
     .Display
    [B] .From "Amendments"[/B]
     .recipients.Add "ESOSTS"
     .recipients.Add "rson@ey.com"
     .Subject = "ESO Powerkey " & MyDate
     .body = "Please see attached the ESO Report for Powerkey Jobs"
    End With
    myAttachments.Add StrDoxDirectory & "ESOPKM- " & MyDate & ".rtf"
    Using Access and Outlook 2003, Thanks
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    Try the SenderName Property of the MailItem Object, as in:
    Code:
    MailItem.SenderName = "Elmer Fudd"

    Comment

    • evilbungle
      New Member
      • Apr 2008
      • 26

      #3
      Originally posted by ADezii
      Try the SenderName Property of the MailItem Object, as in:
      Code:
      MailItem.SenderName = "Elmer Fudd"
      Thanks for this but I can not get it to work as it comes up as property is read only.

      Comment

      Working...