Outlook doesn't provide any direct way to change the account for an outgoing message. See
http://www.outlookcode.com/codedetail.aspx?id=889 for various workarounds that might fit your scenario.

Signature
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
Set CBP = CBs.FindControl(, ID_ACCOUNTS)
here you are passing only two parametersn "null and ID_ACCOUNTS" but when i
converted that code in c# i found in its description that Findcontrol
requires 4 parameters ("Type ,ID ,Tag and visible")...and when i uses
FindControl with 2 paramters, as u mentioned, it returns null...what to do
now ???? plz reply
> Outlook doesn't provide any direct way to change the account for an outgoing message. See
> http://www.outlookcode.com/codedetail.aspx?id=889 for various workarounds that might fit your scenario.
[quoted text clipped - 5 lines]
> > profile from my application.
> > plz reply asap.
Munir - 26 Dec 2005 10:51 GMT
i have tried ur code many times but CBs.FindControl(, ID_ACCOUNTS) alwayz
return null and CBP is alwayz null dont know y... can u plz tell me y it
returns null.
> Set CBP = CBs.FindControl(, ID_ACCOUNTS)
>
[quoted text clipped - 13 lines]
> > > profile from my application.
> > > plz reply asap.
Ken Slovak - [MVP - Outlook] - 26 Dec 2005 15:55 GMT
Sue is on vacation.
All 4 arguments to CommandBars.FindControl are optional arguments. Sue was
passing the second of those arguments: Id. In VBA/VB that's how you can do
it or you can use named arguments such as .FindControl(Id := ID_ACCOUNTS).
How you'd do that in C# I have no idea.
Make sure you declare the equivalent of the Const ID_ACCOUNTS = 31224
statement in C# syntax and do whatever C# requires for named arguments or
passing null arguments. If you look in the Object Browser for
Office.CommandBars.FindControl you will see that the arguments are an enum
of Long (32 bit) for Type and Variants for the other arguments. Id and Tag
are Longs also, Visible is a Boolean.

Signature
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
> Set CBP = CBs.FindControl(, ID_ACCOUNTS)
>
[quoted text clipped - 4 lines]
> FindControl with 2 paramters, as u mentioned, it returns null...what to do
> now ???? plz reply