how to work with different accounts in outlook

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

when i send a email or add new contact/appointment item frm c#.net it usses
defualt account to do so ..my question is how to get the details of all
account when my aapplication interacts with outlook and use a particular
account for sending email.futhermore how can i add a account into outlook's
profile from my application.
plz reply asap.
 
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.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
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
 
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.
 
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.
 
Back
Top