Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: VB5,VB6,II4,II5
Expertise: Intermediate
Jun 23, 2001

AddToIEFavorites - Add a URL to the IE's favorites

' Add an URL to the IE's favorites by sending a client side JavaScript to IE
'   sURL is the URL that the link will point to
'   sDescr is the description displayed in the Favorites menu
'
' Example:
'   AddToIEFavorites "www.vb2themax.com", "VB-2-The-Max: the ultimate VB source"

Sub AddToIEFavorites(ByVal sURL As String, ByVal sDescr As String)
    sURL = LCase(sURL)
    ' add the http:// in case it isn't already present in the specified URL
    If Left$(sURL, 7) <> "http://" Then sURL = "http://" & sURL
    ' open Exploring and load the script
    ShellExecute 0, "Open", "javascript:window.external.AddFavorite('" & sURL & _
        "','" & sDescr & "')", "", "", 0
End Sub
Marco Bellinaso
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap