INFO: Outlook Object Model Unsuitable to Run in an Windows NT Service

ID: Q237913


The information in this article applies to:
  • Microsoft Outlook, versions 2000, 97, 98


SUMMARY

The Outlook Object Model is unsuitable for use from an application designed to be run as, or spawned by, an Windows NT service. This includes Active Server Page (ASP) applications running under Internet Information Service (IIS), and applications being run with the AT Scheduler or Task Scheduler services.

This is a design limitation of Outlook.


MORE INFORMATION

The Outlook Object Model has four major limitations that make it unsuitable for use in an Windows NT service. These limitations are:

  • MAPI stores profiles for each user under the HKEY_CURRENT_USER hive of the registry, this registry hive is not loaded when an Windows NT service runs. This particular issue can be quite deceptive, because during a development cycle, the developer is usually logged onto the system interactively cause the HKEY_CURRENT_USER hive to be loaded, so everything works as expected. Once the service is tested without the owner of the profile logged on interactively the service will fail to locate the profile.


  • Only one instance of Outlook (the application that exports the Outlook Object Model) can run at a time in one user context using a single profile. Any attempts by the same user to logon using a second profile results in joining the existing Outlook session. Attempts to start another copy of Outlook (or the Outlook Object Model) from a different user context (for instance, an application that impersonates a different user, such as an Windows NT service) fails with unpredictable results ranging from; a modal dialog box to an application error causing Outlook to stop responding to the system.


  • The Outlook Object Model always starts the MAPI spooler when logging on. MAPI client applications implemented as Windows NT services must follow several limitations when logging onto the MAPI subsystem. As Outlook was not designed to run as an Windows NT service, these conventions were not followed. For more information regarding this point, see the MSDN topic "Windows NT Service Client Applications"


  • It is possible to perform some actions using the Outlook Object Model that raise modal dialog boxes that cannot be prevented and require user intervention. This would have the affect of causing the Windows NT service application to appear to hang.

Recommendation

If possible, use CDO or Extended MAPI code in your Windows NT service instead of the Outlook Object Model.

Additional query words: OL97 OL98 OL2000

Keywords : kbMsg kbOutlook kbOutlook97 kbOutlook98 kbOutlookObj kbfaq kbGrpMsg kbDSupport kboutlook2000
Version : WINDOWS:2000,97,98
Platform : WINDOWS
Issue type : kbinfo


Last Reviewed: December 3, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.