A new custom form opens behind Outlook (304618)



The information in this article applies to:

  • Microsoft Outlook 2002

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:
  1. Click Start, point to Run, and then type regedit.
  2. Locate and then click the following key in the registry:

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

  3. Right-click Options, click New, and then click DWORD Value.
  4. Type CDO_Focus, and then press ENTER.
  5. Double-click CDO_Focus, and then type 1 in the Value data box.

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

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Modification Type:MinorLast Reviewed:9/23/2005
Keywords:kbHotfixServer kbQFE kbbug kbnofix KB304618