A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Launch multiple Outlook instances as different users.



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old August 15th 07, 08:56 PM posted to microsoft.public.outlook.program_vba
Luke
external usenet poster
 
Posts: 33
Default Launch multiple Outlook instances as different users.

I am trying to automate testing (at least partially) of an Outlook Add-In.
The trick is that I am trying to run Outlook under a different user account
(to access the test mailbox on our Exchange server). Here is what I'm doing
(this is all in C):

Host Process:
1. LogonUser()
2. Modify DACL of default Window Station and Desktop (required for child
process to display UI)
3. LoadUserProfile() to get appropriate HKCU
4. CreateProcessAsUser()

Child Process:
1. CoInitialize()
2. Outlook::_ApplicationPtr::CreateInstance()
3. send messages, traverse folders, etc

If I am running Outlook under my account when the child process launches, it
fails at step 2 fails with 0x80080005 ("server execution failed"). If I am
NOT running Outlook, the child process launches Outlook under the test
account and everything works fine. So it appears that there is a problem
with running multiple instances of Outlook on the same computer under
different user accounts. Is there a workaround? Am I doing something wrong?
Or is this just not supported?

Another problem is that the test account's Outlook profile will have to be
created the first time it is run, but I could probably figure out how to
automate that.

People could just close their instance of Outlook before running the tests,
but that's not a very good solution. Another possibility is to allow my
account/group access to the other account's mailbox, but that would be too
easy. Any ideas?
Ads
  #2  
Old August 16th 07, 02:15 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Launch multiple Outlook instances as different users.

Not supported. Only a single instance of Outlook can be running at a time.

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


"Luke" wrote in message
...
I am trying to automate testing (at least partially) of an Outlook Add-In.
The trick is that I am trying to run Outlook under a different user
account
(to access the test mailbox on our Exchange server). Here is what I'm
doing
(this is all in C):

Host Process:
1. LogonUser()
2. Modify DACL of default Window Station and Desktop (required for child
process to display UI)
3. LoadUserProfile() to get appropriate HKCU
4. CreateProcessAsUser()

Child Process:
1. CoInitialize()
2. Outlook::_ApplicationPtr::CreateInstance()
3. send messages, traverse folders, etc

If I am running Outlook under my account when the child process launches,
it
fails at step 2 fails with 0x80080005 ("server execution failed"). If I
am
NOT running Outlook, the child process launches Outlook under the test
account and everything works fine. So it appears that there is a problem
with running multiple instances of Outlook on the same computer under
different user accounts. Is there a workaround? Am I doing something
wrong?
Or is this just not supported?

Another problem is that the test account's Outlook profile will have to be
created the first time it is run, but I could probably figure out how to
automate that.

People could just close their instance of Outlook before running the
tests,
but that's not a very good solution. Another possibility is to allow my
account/group access to the other account's mailbox, but that would be too
easy. Any ideas?


  #3  
Old August 17th 07, 02:22 AM posted to microsoft.public.outlook.program_vba
Luke
external usenet poster
 
Posts: 33
Default Launch multiple Outlook instances as different users.

Ok, I'll try a different approach. Thanks.

"Ken Slovak - [MVP - Outlook]" wrote:

Not supported. Only a single instance of Outlook can be running at a time.

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


"Luke" wrote in message
...
I am trying to automate testing (at least partially) of an Outlook Add-In.
The trick is that I am trying to run Outlook under a different user
account
(to access the test mailbox on our Exchange server). Here is what I'm
doing
(this is all in C):

Host Process:
1. LogonUser()
2. Modify DACL of default Window Station and Desktop (required for child
process to display UI)
3. LoadUserProfile() to get appropriate HKCU
4. CreateProcessAsUser()

Child Process:
1. CoInitialize()
2. Outlook::_ApplicationPtr::CreateInstance()
3. send messages, traverse folders, etc

If I am running Outlook under my account when the child process launches,
it
fails at step 2 fails with 0x80080005 ("server execution failed"). If I
am
NOT running Outlook, the child process launches Outlook under the test
account and everything works fine. So it appears that there is a problem
with running multiple instances of Outlook on the same computer under
different user accounts. Is there a workaround? Am I doing something
wrong?
Or is this just not supported?

Another problem is that the test account's Outlook profile will have to be
created the first time it is run, but I could probably figure out how to
automate that.

People could just close their instance of Outlook before running the
tests,
but that's not a very good solution. Another possibility is to allow my
account/group access to the other account's mailbox, but that would be too
easy. Any ideas?



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you launch 2 instances of outlook? Crimson Outlook - General Queries 3 May 19th 07 02:57 PM
Multiple OUTLOOK.exe instances running David Outlook - General Queries 2 May 18th 07 03:41 AM
Multiple Instances of Outlook John Mann Outlook and VBA 1 December 8th 06 05:09 PM
Outlook Multiple Instances Appearing? Siv Outlook - General Queries 2 June 21st 06 02:55 PM
Multiple instances of Outlook DS-NTE Outlook - General Queries 1 February 22nd 06 11:51 AM


All times are GMT +1. The time now is 05:04 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.