How can I change session in outlook 2003 with Outlook interop object c#

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hello everybody.
This is my first post and i would like to introduce myself.
My name is Andres and i from Spain (now you know why i write a bad english hehe.).
Im working in a own application that use library Outlook interop object to write an email.
Software specifications:
Outlook 2003
Microsoft visual studio 2008
Visual C#
I have 2 profiles for outlook and i would like to change the default profile by another one. I spent a lot of time looking for a solution for my problem but i cant change profile.
I really use this code but it doesnt work for me:
<div style="color:black; background-color:white
<pre>OutLook.Application objOutlook;



objOutlook = <span style="color:blue new OutLook.ApplicationClass();

OutLook._NameSpace objNameSpace = objOutlook.GetNamespace(<span style="color:#a31515 "MAPI");

objNameSpace.Logon(<span style="color:#a31515 "UserProfile", <span style="color:blue null, <span style="color:blue false,<span style="color:blue true );



[/code]

Everytime that i run this code i get the default profile.
So What am i doing wrong?
PS: I dont want to use third parties.
Thank you so much and sorry for my english.

View the full article
 
Back
Top