Microsoft KB Archive/840996

= Your custom application may not be able to come to the foreground when you use DDE to send commands to Word 2003 =

Article ID: 840996

Article Last Modified on 4/7/2006

-

APPLIES TO


 * Microsoft Office Word 2003

-





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 use Dynamic Data Exchange (DDE) to send commands to Microsoft Office Word 2003, your custom program may not be able to come to the foreground. If you try to switch focus away from the Word 2003 window, Word 2003 will automatically come to the foreground again. You cannot switch from the Word 2003 document or minimize the Word 2003 window while the DDE commands are being sent to Word 2003.



CAUSE
This problem occurs because every time that Word 2003 obtains a WM_DDE_EXECUTE message from the calling program, it calls the SetForegroundWindow API to force itself into the foreground. As the DDE caller continues to automate Word 2003 through DDE, you will not be able to switch to another application because Word 2003 will come back into the foreground.



RESOLUTION
This problem was first fixed in a hotfix that is now contained in a service pack. If you installed the latest Office 2003 service pack, you do not have to install the hotfix.

Service pack information
This problem is corrected in Office 2003 Service Pack 2.

To resolve this problem, obtain the latest service pack for Office 2003. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

870924 How to obtain the latest service pack for Office 2003

After you install the service pack, follow the steps that are listed in the &quot;More Information&quot; section to set the DontJumpForegroundInDDEExec registry key and to enable the hotfix.

How to obtain the hotfix
This issue is fixed in the Word 2003 Hotfix Package that is dated August 20, 2004. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

838899 Description of the Word 2003 post-Service Pack 1 hotfix package: August 20, 2004

After you install this hotfix, follow the steps that are listed in the &quot;More Information&quot; section to set the DontJumpForegroundInDDEExec registry key and to enable the hotfix.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section. This problem was first corrected in Office 2003 Service Pack 2.



MORE INFORMATION
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.

To activate this hotfix, follow these steps:  Quit Word 2003. Click Start, and then click Run. In the Open box, type regedit, and then click OK. Locate and then click to select the following registry key:

HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Word\Options

 After you select the key that is specified in step 4, point to New on the Edit menu, and then click DWORD.</li> Type DontJumpForegroundInDDEExec, and then press ENTER.</li> Right-click DontJumpForegroundInDDEExec, and then click Modify.</li> In the Value data box, type 1, and then click OK.</li> On the File menu, click Exit to quit Registry Editor.</li></ol>

Keywords: kbbug kbfix kbqfe kboffice2003sp1fix kboffice2003sp2fix kbhotfixserver KB840996

-

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

© Microsoft Corporation. All rights reserved.