Microsoft KB Archive/304618

= A new custom form opens behind Outlook =

Article ID: 304618

Article Last Modified on 9/23/2005

-

APPLIES TO


 * Microsoft Outlook 2002 Standard Edition

-



This article was previously published under Q304618



Important This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry



SYMPTOMS
When you open a custom form that uses CDO (Collaboration Data Objects) in Microsoft Outlook 2002, the custom form appears in the background and Outlook 2002 remains in the foreground.



CAUSE
This problem occurs because the CDO methods that starts the dialog box with the following message cause a z-order issue that resets the focus to the Outlook Frame window:

A program is trying to access e-mail addresses you have stored in Outlook. Do you want to allow this

When the Outlook object model activates the same dialog box with the same message, the problem does not occur.



RESOLUTION
Warning If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

This issue is resolved in Microsoft Office XP Service Pack 1.

You must add the following value to the Windows registry after you apply Microsoft Office XP Service Pack 1 to resolve the issue:  Click Start, point to Run, and then type regedit . Locate and then click the following key in the registry:

HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Outlook\Options

 Right-click Options, click New, and then click DWORD Value. Type CDO_Focus, and then press ENTER. Double-click CDO_Focus, and then type 1 in the Value data box.</ol>

<div class="moreinformation_section">

MORE INFORMATION
You can also work around this problem by using the Outlook object model in your custom forms for the property that you need, instead of using CDO. The following example demonstrates how to use the Outlook object model for the property instead of CDO:

Using CDO:

MAPI.Session.CurrentUser

Using the Outlook object model:

Item.Session.CurrentUser

<div class="status_section">

STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.

Additional query words: kbOutlook2002

Keywords: kbbug kbnofix kbqfe kbhotfixserver KB304618

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.