Microsoft KB Archive/174966

From BetaArchive Wiki

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:

Ambiguous Name Detected: TmpDDE


This message is returned by Visual Basic for Applications when the Word Global Template ( 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 ( file. -or-

  • Renaming the Microsoft Word Global Template ( 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 ( 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 ( 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 ( file

Steps to Reproduce Behavior

  1. Open Microsoft Word 97.
  2. Create a Word document named Testdoc.doc and save it in the c:\program files\microsoft office\office folder.
  3. From the File menu, select Open and select usually located in the c:\program files\microsoft office\templates folder.
  4. From the Tools menu, select Macro, and click Macros.
  5. In the "Macros in" box of the Macros dialog box, select template).
  6. Enter TmpDDE in the Macro Name Field.
  7. Click Create to open the Visual Basic for Applications Code window.
  8. Save the macro.
  9. Exit Visual Basic for Applications and Word 97.
  10. Open FoxPro for Windows 2.x or Visual FoxPro 3.0x or 5.0x.
  11. 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