WWW Hyperlink Coding

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have this code for a button that excutes based on the data in the box next
to it, what should I change to do this? This data is www.domainname.com I
want this button to be able to pull this up
http://whois.sc/www.domainname.com. So when you click on the button, it will
take this string "http://whois.sc/" and insert whatever value I have in the
data box, like www.domainname.com and excute that line like"
http://whois.sc/www.domainname.com in a browser.

On Error GoTo handler
Strwww = "http://" & [www]
Application.FollowHyperlink Address:=Strwww
handler:
If Err.Number = 4 Then
End If
If Err.Number = 5 Then
End If

Thanks
Curtis
 
Curtis Stevens said:
I have this code for a button that excutes based on the data in the
box next to it, what should I change to do this? This data is
www.domainname.com I want this button to be able to pull this up
http://whois.sc/www.domainname.com. So when you click on the button,
it will take this string "http://whois.sc/" and insert whatever value
I have in the data box, like www.domainname.com and excute that line
like" http://whois.sc/www.domainname.com in a browser.

On Error GoTo handler
Strwww = "http://" & [www]
Application.FollowHyperlink Address:=Strwww
handler:
If Err.Number = 4 Then
End If
If Err.Number = 5 Then
End If

Thanks
Curtis

Maybe I'm not understanding you correctly, but it looks like all you
need is to change this:
Strwww = "http://" & [www]

to this:

Strwww = "http://whois.sc/" & [www]
 
Maybe I'm not understanding you correctly, but it looks like all you
need is to change this:
Strwww = "http://" & [www]

to this:

Strwww = "http://whois.sc/" & [www]


I tired that. Basically I have one field that contains their web site
address, like www.yahoo.com. I want to be able to click that button and have
it launch a browser using that site above - the data in it, but be in this
particular format - the address it actually pulls up:

http://whois.sc/ This is where it inserts the data in the www field box,
like www.yahoo.com

Am I making sense?

Curtis
 
Curtis Stevens said:
Maybe I'm not understanding you correctly, but it looks like all you
need is to change this:
Strwww = "http://" & [www]

to this:

Strwww = "http://whois.sc/" & [www]


I tired that. Basically I have one field that contains their web site
address, like www.yahoo.com. I want to be able to click that button
and have it launch a browser using that site above - the data in it,
but be in this particular format - the address it actually pulls up:

http://whois.sc/ This is where it inserts the data in the www field
box, like www.yahoo.com

Am I making sense?

Looking at the site, I think I see better what you're after. You could
probably do it in a complex and sophisticated way by manipulating the
browser object, but watching it operate leads me to believe that you can
get what you want like this:

Dim astrTokens() As String
Dim I As Integer

astrTokens = Split([www], ".")
I = UBound(astrTokens)

Strwww = "http://whois.sc/" & _
astrTokens(I - 1) & "." & astrTokens(I)

Application.FollowHyperlink Strwww
 
Back
Top