Outlook 2007 adds a MailItem.SendUsingAccount property.
For earlier versions, Outlook provides no direct way to change the account for an outgoing message. These are known workarounds using native Outlook functionality:
1) If the user has Outlook 2002/3 and is not using WordMail as the editor, you set the sending account using CommandBars techniques. See
http://www.outlookcode.com/codedetail.aspx?id=889 for sample code.
2) In an Exchange environment where you want to use another user's mailbox as the From address, set the MailItem.SentOnBehalfOfName property. If you do not want the current user's name to appear in the message at all, the Exchange administrator must grant Send As permission on the other user's mailbox.
3) If you're mainly concerned about replies to your message going to the correct place, add the desired reply address to the MailItem.ReplyRecipients collection.
The third-party Redemption (
http://www.dimastr.com/redemption/ ) library adds two other solutions:
4) Set an RFC822 header property, as described at
http://www.dimastr.com/redemption/faq.htm#14
5) Set the RDOMail.Account property, as described at
http://www.dimastr.com/redemption/rdo/RDOMail.htm
FYI, there is a newsgroup specifically for general Outlook programming issues "down the hall" at microsoft.public.outlook.program_vba or, via web interface, at
http://www.microsoft.com/office/comm...ok.program_vba
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
"SilvrT" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
>I am creating an "auto responder" in Outlook 2000. It looks at
> incoming emails and depending on the source, sends an auto response
> back to the sender. I have worked out most of the code with one
> exception. Depending on the source of the email, I need to populate
> the "From" field with a different email address so that the response
> appears to be coming from a different addy other than my own. The from
> field seems to be "read only" because I get that error whenever I try
> and put anything into it (again, in code).
>
> Anyone have any ideas?
>
> Thanks
>