![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
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 |