PRB: DDE with Word 97 Returns 'Ambiguous Name Detected: TmpDDE'

Last reviewed: December 26, 1997
Article ID: Q174966
The information in this article applies to:
  • Microsoft FoxPro for Windows, versions 2.5, 2.5a, 2.5b, 2.6, 2.6a
  • Microsoft Visual FoxPro for Windows, versions 3.0, 3.0b, 5.0, 5.0a
  • Microsoft Word 97 for Windows

SYMPTOMS

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

CAUSE

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.

RESOLUTION

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.

STATUS

This behavior is by design.

MORE INFORMATION

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

  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 Normal.dot 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 Normal.dot(global 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+'"]')
    

REFERENCES

For additional information, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q165860
   TITLE     : OFF97 Err Msg: "Ambiguous Name Detected" Appears When Faxing


Additional query words: OFF97 WORD97 DDE
Keywords : FoxWin FxinteropDde FxinteropWinword vfoxwin kberrmsg
Version : WINDOWS:2.5,2.5a,2.5b,2.6,2.6a,3.0,3.0b,5.0,5.0a,97
Platform : WINDOWS
Issue type : kbprb


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: December 26, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.