By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,853 Members | 2,246 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,853 IT Pros & Developers. It's quick & easy.

Setting From criteria when automating outlook from Access 03

P: 26
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.

Expand|Select|Wrap|Line Numbers
  1.  Set myOutlook = CreateObject("Outlook.Application")
  2.  
  3. Set myMailItem = myOutlook.CreateItem(0)
  4. Set myAttachments = myMailItem.Attachments
  5. With myMailItem
  6.  .Display
  7.  .From "Amendments"
  8.  .recipients.Add "ESOSTS"
  9.  .recipients.Add "rson@ey.com"
  10.  .Subject = "ESO Powerkey " & MyDate
  11.  .body = "Please see attached the ESO Report for Powerkey Jobs"
  12. End With
  13. myAttachments.Add StrDoxDirectory & "ESOPKM- " & MyDate & ".rtf" 
Using Access and Outlook 2003, Thanks
Sep 24 '08 #1
Share this Question
Share on Google+
2 Replies


ADezii
Expert 5K+
P: 8,627
Try the SenderName Property of the MailItem Object, as in:
Expand|Select|Wrap|Line Numbers
  1. MailItem.SenderName = "Elmer Fudd"
Sep 24 '08 #2

P: 26
Try the SenderName Property of the MailItem Object, as in:
Expand|Select|Wrap|Line Numbers
  1. MailItem.SenderName = "Elmer Fudd"
Thanks for this but I can not get it to work as it comes up as property is read only.
Sep 25 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.