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 Add-Ins / March 2008

Tip: Looking for answers? Try searching our database.

How to choose acount in Outlook 2007 in c#

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vlasta - 28 Mar 2008 15:43 GMT
Can anybody help me how to choose acount in Outlook 2007 in c#? I have C#
application and I need to send from that application email, but not with
current acount, but with acount I choose. I try it with
mailItem.sendUsingAcount  , but with no result.
My code looks like this:

Outlook.Application outlook = new Outlook.Application();
 Outlook.MailItem mailItem =
(Outlook.MailItem)outlook.CreateItem(Outlook.OlItemType.olMailItem);        
           mailItem.Subject = "somethink";
           mailItem.To = "email adres";
           mailItem.Body = "Text in body";
           mailItem.Importance = Outlook.OlImportance.olImportanceLow;
           mailItem.Display(false);
           mailItem.Send();

Thanks for answer   Vlasta
Ken Slovak - [MVP - Outlook] - 28 Mar 2008 16:38 GMT
SendUsingAccount is exactly what you want to use. Have you looked at the
code sample for using it in the Object Browser Help for SendUsingAccount? It
does work.

Signature

Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm

> Can anybody help me how to choose acount in Outlook 2007 in c#? I have C#
> application and I need to send from that application email, but not with
[quoted text clipped - 13 lines]
>
> Thanks for answer   Vlasta
Vlasta - 28 Mar 2008 18:38 GMT
I tried to find somethink, but unfortunately I wasn't succsessful. Can you
give me some link with code sample? Please.
Thanks  Vlasta

> SendUsingAccount is exactly what you want to use. Have you looked at the
> code sample for using it in the Object Browser Help for SendUsingAccount? It
[quoted text clipped - 17 lines]
> >
> > Thanks for answer   Vlasta
SvenC - 28 Mar 2008 19:36 GMT
Hi Vlasta,

> I tried to find somethink, but unfortunately I wasn't succsessful.
> Can you give me some link with code sample? Please.
> Thanks  Vlasta

How did you search?
Try this:

http://www.google.com/search?q=sendUsingAccount
or
http://search.live.com/results.aspx?q=sendUsingAccount

Both show a sample on the first search result.

--
SvenC
 
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.