Solved

HyperlinkToURL

Posted on 2006-10-24
3
778 Views
Last Modified: 2013-12-26
Hi
I use the HyperlinkToURL ( string url ) function of the Inet object, but I have problems with the url.

I need encode the arguments values of the url same as java do it with java.net.URLEncoder.encode(String s).

Thanks.
0
Comment
Question by:sarevalo
3 Comments
 
LVL 6

Accepted Solution

by:
tr1l0b1t earned 250 total points
ID: 17833022
Hi,

You could use the Javascript engine from PowerScript
and use the "escape" function. A working sample script :

--------------8<--------------8<--------------8<--------------

OleObject l_ole
Inet lsvc_inet
String ls_temp

// URL to encode
String ls_URL = "www.yourpage.com/sample page with spaces.htm"

l_ole = CREATE OleObject
If l_ole.ConnectToNewObject("MSScriptControl.ScriptControl") = 0 Then
      l_ole.language = "javascript"
      // encode
      ls_temp = l_ole.Eval("escape('" + ls_URL + "')")
      DESTROY l_ole
Else
      MessageBox("Error1", "...")
      Return -1
End If

// finally we open the encoded URL
If GetContextService("Internet", lsvc_inet) > 0 Then
      lsvc_inet.HyperlinkToURL( ls_temp )
Else
      MessageBox("Error2", "...")
End If

--------------8<--------------8<--------------8<--------------

Hope it helps
Regards
0
 

Author Comment

by:sarevalo
ID: 17833811
Thanks, yours solution was helpful for me.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org (http://seleniumhq.org) Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now