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
- Set myOutlook = CreateObject("Outlook.Application")
- Set myMailItem = myOutlook.CreateItem(0)
- Set myAttachments = myMailItem.Attachments
- With myMailItem
- .Display
- .From "Amendments"
- .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"