Microsoft KB Archive/174966
PSS ID Number: 174966
Article Last Modified on 5/12/2003
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 3.0
- Microsoft Visual FoxPro for Windows 3.0b
- Microsoft Visual FoxPro for Windows 5.0
- Microsoft Visual FoxPro for Windows 5.0a
- Microsoft Visual FoxPro for Windows 6.0
- Microsoft FoxPro for Windows 2.5
- Microsoft FoxPro for Windows 2.5a
- Microsoft FoxPro for Windows 2.5b
- Microsoft FoxPro for Windows 2.6
- Microsoft FoxPro for Windows 2.6a
- Microsoft Word 97 for Windows
This article was previously published under Q174966
When using the DDEExecute() function to send a WordBasic command to Word 97 from FoxPro, Visual Basic for Applications returns the following error message:
This message is returned by Visual Basic for Applications when the Word Global Template (Normal.dot) contains a macro named TmpDDE, and an attempt is made to execute a Word command using the FoxPro DDEExecute( ) function.
This problem may be resolved by any of the following methods:
- Deleting the TmpDDE macro from the MS Word Global Template (Normal.dot) file. -or-
- Renaming the Microsoft Word Global Template (Normal.dot) file.
This behavior is by design.
When DDEExecute(nChannel,"[WordCommand]") is used to pass a command to Word 97, Word 97 attempts to create a new TmpDDE macro in the Global Template (Normal.dot) file. The TmpDDE macro is released after the Word Command passed by DDEExecute() is executed. Word 97 is unable to create the TmpDDE macro if the Global Template (Normal.dot) contains an existing macro of the same name. This behavior is not observed when macros with names other than TmpDDE are present in the Global Template (Normal.dot) file
Steps to Reproduce Behavior
- Open Microsoft Word 97.
- Create a Word document named Testdoc.doc and save it in the c:\program files\microsoft office\office folder.
- From the File menu, select Open and select Normal.dot usually located in the c:\program files\microsoft office\templates folder.
- From the Tools menu, select Macro, and click Macros.
- In the "Macros in" box of the Macros dialog box, select Normal.dot(global template).
- Enter TmpDDE in the Macro Name Field.
- Click Create to open the Visual Basic for Applications Code window.
- Save the macro.
- Exit Visual Basic for Applications and Word 97.
- Open FoxPro for Windows 2.x or Visual FoxPro 3.0x or 5.0x.
Create a program file called test, containing the following code:
RUN /n "c:\program files\microsoft office\office\winword.exe" wordchannel = DDEInitiate("Winword","System") docname = "c:\program files\microsoft office\office\testdoc.doc" =DDEExecute(wordchannel, '[FileOpen .name="'+docname+'"]')
For additional information, please see the following article in the Microsoft Knowledge Base:
165860 OFF97 Err Msg: "Ambiguous Name Detected" Appears When Faxing
Additional query words: OFF97 WORD97 DDE
Keywords: kberrmsg kbprb KB174966
Technology: kbAudDeveloper kbFoxPro250 kbFoxPro250a kbFoxPro250b kbFoxPro260 kbFoxPro260a kbFoxproSearch kbVFP300 kbVFP300b kbVFP500 kbVFP500a kbVFP600 kbVFP600Search kbVFPsearch kbWord97 kbWord97Search kbWordSearch kbZNotKeyword2