Link to home
Start Free TrialLog in
Avatar of jsquek
jsquek

asked on

Create Domino button to open URL and add page to "Favorites"

I would like to create a button that, when the user clicks on it, will open IE, take them to the appropriate URL and then add this URL to their "Favorites" in IE. Is this possible? Thanks.
Avatar of p_partha
p_partha

@urlopen("javascript:window.external.AddFavorite('http://www.google.com','google')")

Partha
or just give this in button after changing it to javascript:

window.external.AddFavorite('http://www.google.com','google')

Partha
Avatar of jsquek

ASKER

I added the urlopen code to a button and got the following error: A JavaScript was encountered. Error: windows.external has no properties. Forgive me but I am a newbie developer. Thanks.
did u try my second post ... it's just javascript

Partha
>> take them to the appropriate URL

window.open (URL, WinName, WinOptions)

>> and then add this URL to their "Favorites" in IE. Is this possible?

Yes, it is possible. However, it doesn't happen automatically. It prompts the user whether he/she wants to allow teh site to add a bookmark to their favorite. The code Partha already gave above. It works. See this page: http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/addfavorite.asp
Be sure about the capitalization. A and F in AddFavorite must be in upper case.
Avatar of jsquek

ASKER

Partha and Ranjeet,

I tried this code in a Domino hotspot button:

window.open ('www.google.com')
window.external.AddFavorite('http://www.google.com','Test - google')

and got the following error message: Error: ToObjectError: window.external has no properties.

I copied and pasted both lines of code from your comments. Any ideas? Thanks a bunch
what is ur IE version?

Partha
Are you opening the URLs from IE? Or are you using Notes' built-in browser? I am not sure whther Notes' built in browser supports external object.
Avatar of jsquek

ASKER

My IE is version 6.0.2800.1106. Operating platform is XP SP1. Do you happen to know if similar code exists in LotusScript? Thanks.
The @UrlOpen does nto work, because it always assumes that there should be a :// protocol -- http:// or ftp:// -- and adds it if not present.  A URL link might work, or hand-coded Javascript or HTML.
Avatar of jsquek

ASKER

On my last post with the code I used ..., I had selected Javascript

I tried this code in a Domino hotspot button:

window.open ('www.google.com')
window.external.AddFavorite('http://www.google.com','Test - google')

and got the following error message: A JavaScript was encountered. Error: ToObjectError: window.external has no properties.

I copied and pasted both lines of code from your comments. Any ideas? Thanks a bunch
ASKER CERTIFIED SOLUTION
Avatar of RanjeetRain
RanjeetRain

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Forgot the part two :)


      ' Part 1
      Dim retVal As Integer
      retVal = Shell("explorer http://www.google.com", 1)

      ' Part 2
      Dim IEObj As Variant
      Set  IEObj =  createobject("Shell.UIHelper.1")
      IEObj.AddFavorite "http://www.google.com","Google"