msoutlook.org Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Outlook program with multiple profiles

 
Post new topic   Reply to topic    msoutlook.org Forum Index -> Outlook Interop
Author Message
Atul Thombre



Joined: 28 Jan 2008
Posts: 2

PostPosted: Tue Jan 29, 2008 3:10 am    Post subject: Outlook program with multiple profiles Reply with quote

Hello,

I am writing a program using Outlook Object Model. The program sequentially
connects to two profiles. The first call to Logon() prompts for the
password, but somehow the second call does not prompt me for the password.

I also observed that when the first connection ends (after the call to
NameSpace.Logoff() and Application.Quit()) the Outlook.exe process
disappears from the Task Manager. But, when the Logon() call is made, the
Outlook logs in using the first profile.

I am calling Marshal.ReleaseComObject() for every instance of COM object
created and also have calls for GC.Collect() and
GC.WaitForPendingFinalizers().

Can someone shed some light on this?

Thanks,

Atul.

Archived from group: microsoft>public>outlook>interop
Back to top
View user's profile Send private message
Dmitry Streblechenko



Joined: 12 Aug 2007
Posts: 220

PostPosted: Tue Jan 29, 2008 6:26 pm    Post subject: Re: Outlook program with multiple profiles Reply with quote

How do you know the second Logon uses the first profile?
Do you use any other libraries (e.g. CDO 1.21 or Redemption) besides Outlook
that might keep the first MAPI session alive?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Atul Thombre" wrote in message
news:%23NPT3zcYIHA.3400@TK2MSFTNGP03.phx.gbl...
> Hello,
>
> I am writing a program using Outlook Object Model. The program
> sequentially connects to two profiles. The first call to Logon() prompts
> for the password, but somehow the second call does not prompt me for the
> password.
>
> I also observed that when the first connection ends (after the call to
> NameSpace.Logoff() and Application.Quit()) the Outlook.exe process
> disappears from the Task Manager. But, when the Logon() call is made, the
> Outlook logs in using the first profile.
>
> I am calling Marshal.ReleaseComObject() for every instance of COM object
> created and also have calls for GC.Collect() and
> GC.WaitForPendingFinalizers().
>
> Can someone shed some light on this?
>
> Thanks,
>
> Atul.
Back to top
View user's profile Send private message
Atul Thombre



Joined: 28 Jan 2008
Posts: 2

PostPosted: Wed Jan 30, 2008 9:23 pm    Post subject: Re: Outlook program with multiple profiles Reply with quote

"Dmitry Streblechenko" wrote in message $LVUrYIHA.6140@TK2MSFTNGP02.phx.gbl...
> How do you know the second Logon uses the first profile?

I get the default store, and print its name. It displays the name of the
first mailbox

> Do you use any other libraries (e.g. CDO 1.21 or Redemption) besides
> Outlook that might keep the first MAPI session alive?

Nope. I am not using any CDO or Redemption calls. But I am using 'Profiles'
for creating profiles... both of them.

In fact, I wrote a test program that has two push buttons and a text box. In
the handlers for the push button, I wrote some code to logon to Exchange
using Outlook Object Model, and then print the name of the default store in
the text box. I used two different profiles in the handlers for the two push
buttons. But the behavior was the same. Here I am not even creating a
profile, I am using profiles already created.

Atul.

>
> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
>
> "Atul Thombre" wrote in message
> news:%23NPT3zcYIHA.3400@TK2MSFTNGP03.phx.gbl...
>> Hello,
>>
>> I am writing a program using Outlook Object Model. The program
>> sequentially connects to two profiles. The first call to Logon() prompts
>> for the password, but somehow the second call does not prompt me for the
>> password.
>>
>> I also observed that when the first connection ends (after the call to
>> NameSpace.Logoff() and Application.Quit()) the Outlook.exe process
>> disappears from the Task Manager. But, when the Logon() call is made, the
>> Outlook logs in using the first profile.
>>
>> I am calling Marshal.ReleaseComObject() for every instance of COM object
>> created and also have calls for GC.Collect() and
>> GC.WaitForPendingFinalizers().
>>
>> Can someone shed some light on this?
>>
>> Thanks,
>>
>> Atul.
>
>

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
Cannot delete profiles through mail applet in Control Panel Hi: Last week when I tried to open my Outlook 2003, I got the following message "Unable to open default e-mail folders and outlook could not start because a data file to send and receiveve mail could not be found" (1). Since I am connected to Exchange Ser

outlook forms my user is running outlook 2002. when she accesses her Junk folder, an office assistant box opens saying "the custom form could not be opened. outlook will use an outlook form instead. there is not enough disk space to copy the form to your computer. c

Outlook OST File How can I recover from a OST file when the Echange environment is gone?

hyperlink to message in outlook Hi, I know how to open an outlook folder with an hyperlink from somewhere else, let say excel: I had an hyperlink Folder\Child Folder1\Child Folder2\ How can I click on a text and have a message in Outlook to open? I now have a wierd way to

Outlook calendar items This is a two part question. 1) Is there a setting on Outlook, that allows one to keep old calendar items listed. What I see is that after 6 months, unless the item is recurring, it will drop off the user's calendar. I am not finding a setting that allows
Post new topic   Reply to topic    msoutlook.org Forum Index -> Outlook Interop All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group