Oulook from Access - Designating the Email Sender

J

Joe D

I have developed code (with help from past entries in this forum - thanks) to
write email from Access 2003 to Outlook 2003 (using object model). Works
fine ... except stumped on designating the "From" email address or name in
code. There are multiple addresses in Outlook. And no .From parameter
appears in the object model. When I use .SenderName or .SenderEmailAddress I
get an error message that this is "Read-only". (e.g. using
..SenderEmailAddress = [email protected]).

Probably an easy way to fix this, but can't seem to find it. Is there one?

Any help much appreciated.

TIA

Joe
 
S

Stefan Hoffmann

hi Joe,

Joe said:
Probably an easy way to fix this, but can't seem to find it. Is there one?
How do you change the sender in Outlook manually?

mfG
--> stefan <--
 
J

Joe D

How do you change the sender in Outlook manually?

Well, manually, "Accounts" is chosen from the Mail Message menu and the
appropriate sender is chosen. But I want this to be automatic with
completely hands-off operation fed from an Access module. Everything else
feeds perfectly.

Any guidance? Is there a CommandBars sequence that will do this? Or direct
command (like the .To =, .Subject =, etc. parameters).

Thanks
 
S

Stefan Hoffmann

hi Joe,

Joe said:
Well, manually, "Accounts" is chosen from the Mail Message menu and the
appropriate sender is chosen.
I suppose you have to do the same via automation. So use the object
browser in the VBA IDE to look for Accounts.



mfG
--> stefan <--
 
A

Alt255

Well, manually, "Accounts" is chosen from the Mail Message menu and the
appropriate sender is chosen. But I want this to be automatic with
completely hands-off operation fed from an Access module. Everything else
feeds perfectly.

Any guidance? Is there a CommandBars sequence that will do this? Or direct
command (like the .To =, .Subject =, etc. parameters).

Thanks

Use the SentOnBehalfOfName property for your mail item.
 
J

Joe D

Actually, there is no "Accounts" parameter available. See reply from Alt255.
.SentOnBehalfOfName = "xxx.xxx@xxx" works perfectly. Go figure. That
would have been about my last guess.

Thanks for your replies and time.
 
J

Joe D

Many thanks for your reply. It works perfectly - and it's about the last
thing I would have thought of. Once again the forum comes through - I
appreciate your expertise.

Joe
 
Top