Changing the "From" field in Outlook using Excel macro
Afternoon all, here's hoping that someone might know off hand something
that's perplexing me.
I'm running some code that creates e-mails and sends (no attachment). I'm
using the SendKeys method to bypass the Outlook security warning, as
3rd-party apps aren't suitable, and using CDO isn't an option due to needing
to keep a copy in "Sent".
However, just to mix it up, I need to be able to amend the "From" field in
the Mail to be sent.
Currently it generates and sends ok using:
With OutMail
.To = addressees
.CC = ""
.BCC = ""
.Subject = "Password to Access File to Follow"
.Body = strbody
.Display
Application.Wait (Now + TimeValue("0:00:02"))
Application.SendKeys "%S"
End With
Adding a line stating ".From = unusualaddress" doesn't amend the From field
in the message, sending instead with the default sender options for the
Outlook account - ie my personal one rather than a specific other address
(which I can send from normall).
Had a look through RDB's site where I would normally go for this kind of
thing, but couldn't find anything about amending the From field.
Anyone got any ideas to save what's left of my hair?
TIA
|