Article ID: 182034 - Last Review: March 16, 2005 - Revision: 2.2 How To Invoke the "Add to Favorites" Dialog Box in IE4This article was previously published under Q182034 On This PageSUMMARY
The "Add to Favorites" dialog box provides a user interface for the user to
save a Web page as a favorite. The ShellUIHelper::AddFavorite method can be
used to invoke this dialog box from a Visual C++ or Visual Basic
application or from script on a Web page.
Please note that you must install the Internet Client SDK before you can implement this code in Visual C++. Also, you must install the desktop update that comes with Internet Explorer 4.0x in order to use the ShellUIHelper object. MORE INFORMATION
The AddFavorite method takes two parameters. The first parameter is the URL
of the Web page to save as a favorite. The second parameter is the title to
be used for this favorite (optional).
When specifying the URL to save as a favorite, you must specify the protocol type (http://, file://, and so forth) If you do not specify the protocol, AddFavorite will return E_FAIL (0x80004005) in Visual C++, and a run-time error in Visual Basic or script. ScriptingVisual C++To invoke the "Add to Favorites" dialog box from a Visual C++ application that is hosting the WebBrowser control, insert the following code in your application:Visual BasicTo invoke this dialog box in a Visual Basic application, add a reference to Shdocvw.dll to your project if your application is not hosting the WebBrowser control:REFERENCES
For additional information, please see the following article in the
Microsoft Knowledge Base:
183339
(http://support.microsoft.com/kb/183339/EN-US/
)
OC: window.external Supports All Methods of ShellUIHelper
For more information, see the MSDN Online Web Workshop:
http://msdn.microsoft.com/workshop
(http://msdn.microsoft.com/workshop/)
(c) Microsoft Corporation 1998, All Rights Reserved. Contributions by Scott Roberts, Microsoft Corporation APPLIES TO
| Article Translations
|

Back to the top
