WD97: Run-Time Error '4599' Using DDE to Internet Explorer 4.x

Last reviewed: February 11, 1998
Article ID: Q178879
The information in this article applies to:
  • Microsoft Word 97 for Windows

SYMPTOMS

In versions of Microsoft Internet Explorer earlier than Microsoft Internet Explorer version 4.x, dynamic data exchange (DDE) commands could be used to extract the Uniform Resource Locator (URL) address from the browser. For instance, the following sample Microsoft Visual Basic for Applications code would display the URL address in a message box:

   Sub ShowUrl()
      IEchannel = DDEInitiate("iexplore", "www_getwindowinfo")
      Info = DDERequest(IEchannel, "dogetwindowinfo")
      MsgBox Info
      DDETerminateAll
   End Sub

This code no longer works with Microsoft Internet Explorer version 4.x and returns the following error message:

   Run-time error '4599': Process failed in other application

WORKAROUND

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

   http://www.microsoft.com/support/supportnet/refguide/default.asp

The following sample Visual Basic code displays the URL address for each window displayed in the Microsoft Internet Explorer browser:

   Sub FindIE40Url()
      Dim IEWindows As New SHDocVw.ShellWindows
      Dim oIE As SHDocVw.InternetExplorer
      On Error GoTo errorhandler
      For Each oIE In IEWindows
         MsgBox "Caption: " & oIE.LocationName & vbCr & "URL: " _
            & oIE.LocationURL
      Next
   errorhandler:
      If Err <> 0 then
         MsgBox " Microsoft Internet Explorer must be running" _
            & " for this code to work."
      End If
   End Sub

Note: For this code to work, you must reference the "Microsoft Internet Controls." To add the "Microsoft Internet Controls" reference, follow these steps:

  1. In the Visual Basic Editor, click References on the Tools menu.

    The References dialog box shows all object libraries and projects that are registered with the operating system.

  2. In the Available References list, scroll down to find "Microsoft Internet Controls."

  3. Click to select the "Microsoft Internet Controls" check box, and then click OK.

MORE INFORMATION

For more information about the Microsoft Internet Explorer 3.x Automation object, please see the "Web Browse Objects" documentation available at the following Microsoft World Wide Web site:

   http://www.microsoft.com/intdev/sdk

NOTE: Because the Microsoft Web site is constantly updated, the site address may change without notice. If this occurs, link to the Microsoft home page at the following address:

   http://www.microsoft.com/

You can also obtain information about the Microsoft Internet Explorer 3.x Automation object by searching on "InternetExplorer Object" in the ActiveX SDK online documentation.

For Microsoft Internet Explorer 4.x, refer to the "Reusing the WebBrowser Control" in the "Internet Tools and Technologies" book of the Internet Client SDK documentation, or search on "InternetExplorer" in the Internet Client SDK documents index.

The Internet Client Software Development Kit (SDK) provides the necessary tools, samples, and documentation for authoring content for the Web and the desktop, for developing controls and components, and for writing applications for the Internet. This SDK also allows you to take advantage of technology provided by Microsoft Internet Explorer version 4.x.

For more information about the Internet Client SDK, please see the following Microsoft World Wide Web sites:

   http://www.microsoft.com/msdn/sdk/

   -and-

   http://www.microsoft.com/intdev/sdk/

NOTE: Because the Microsoft Web site is constantly updated, the site address may change without notice. If this occurs, link to the Microsoft home page at the following address:

   http://www.microsoft.com/

REFERENCES

For more information about getting help with Visual Basic for Applications, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q163435
   TITLE     : VBA: Programming Resources for Visual Basic for
               Applications


Additional query words: vba
Keywords : kbcode kbprg kbwordvba IntpDde
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbprb
Solution Type : kbworkaround


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: February 11, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.