Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / December 2005

Tip: Looking for answers? Try searching our database.

how to work with different accounts in outlook

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Munir - 23 Dec 2005 11:46 GMT
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.
Sue Mosher [MVP-Outlook] - 23 Dec 2005 13:48 GMT
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

> 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.
Munir - 26 Dec 2005 06:51 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.