PC Review


Reply
Thread Tools Rate Thread

Changing the "From" field in Outlook using Excel macro

 
 
DS
Guest
Posts: n/a
 
      23rd Sep 2008
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
 
Reply With Quote
 
 
 
 
Ron de Bruin
Guest
Posts: n/a
 
      23rd Sep 2008
See the Tips page
You can find a link on each example mail page I have on my site
http://www.rondebruin.nl/mail/tips2.htm


If you want to change the sender name and reply address add this code line

'The receiver can see the original mail address in the properties if he want
.SentOnBehalfOfName = """SenderName"" <(E-Mail Removed)>"





--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"DS" <(E-Mail Removed)> wrote in message news:26099A5C-9079-4670-8222-(E-Mail Removed)...
> 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

 
Reply With Quote
 
DS
Guest
Posts: n/a
 
      24th Sep 2008
Ron, you are an absolute legend amongst men. Works like a charm.

Many Thanks,
DS

"Ron de Bruin" wrote:

> See the Tips page
> You can find a link on each example mail page I have on my site
> http://www.rondebruin.nl/mail/tips2.htm
>
>
> If you want to change the sender name and reply address add this code line
>
> 'The receiver can see the original mail address in the properties if he want
> .SentOnBehalfOfName = """SenderName"" <(E-Mail Removed)>"
>
>
>
>
>
> --
>
> Regards Ron de Bruin
> http://www.rondebruin.nl/tips.htm
>
>
> "DS" <(E-Mail Removed)> wrote in message news:26099A5C-9079-4670-8222-(E-Mail Removed)...
> > 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

>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing "From" field in Outlook Mail Merge taubepat@wellsfargo.com Microsoft Outlook Discussion 2 20th Sep 2007 06:46 AM
Outlook adding " (E-mail)" to EmailDisplayName field in "To:" and "CC:" boxes StepHenHairNet Microsoft Outlook Contacts 6 16th Jun 2005 03:46 PM
"Clean Me" Macro is giving "#VALUE!" error in the Notes field. =?Utf-8?B?UnlhbiBXYXRraW5z?= Microsoft Excel Programming 1 11th Jun 2005 12:25 AM
changing from "business" to "home" address as the default field sh =?Utf-8?B?YWRicHN5?= Microsoft Outlook Contacts 1 21st Oct 2004 09:23 PM
Changing Outlook 2002 email "From" field without the "on behalf of" text Ed Microsoft Outlook 0 7th Nov 2003 02:58 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:26 PM.