Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Hyperlinks in VB

Status
Not open for further replies.

Harlequin007

Technical User
Feb 9, 2004
249
GB
Guys

I'm sure the answer in in this forum somewhere or out there on the Internet but I have tried for weeks now to find a way of embedding a hyperlink into an object on a form.

Well, after much caffiene and nicotine and thumping the keyboard at every damn error I got it.

I should have realised how simple it was:

Shell ("C:\Program Files\Internet Explorer\IEXPLORE.EXE vbNormalNoFocus

There ya have it. I'm sure there are other ways, but 1 line of code...? No API, No OCX. If I was a cat I'd be purring :)



-----------------
Cogito Ergo Sum
-----------------
 
You might want to account for the likelihood that IE will often be at a different place than in "C:\Program Files" (say, "D:\Program Files"?)
 
I'll get to that problem eventually WG. The program i've developed will only be run on Win 2k machines at the moment though.

Thanks for the rminder.


-----------------
Cogito Ergo Sum
-----------------
 
W2K machines that definitely have IE installed? Remember, it isn't the only browser...
 
I know Strong - But Hey - I'm a newbie :)


-----------------
Cogito Ergo Sum
-----------------
 
Check out faq222-2066.

It doesn't only open documents using registered applications but it also opens hyperlinks using the default browser.
 
is there a different way to do this? without using shell?
 
You can create your own form copntaining a webbrowser control if you only want to the user to be able to view the page. This way, all the users actions stay within the confines of your vb app.

BB
 
To use Shell without assumptions about default browsers try:

Shell "RUNDLL32.EXE URL.DLL, FileProtocolHandler vbNormalFocus

As Hokje says!

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
Yep, and that's the solution I was thinking of as well
 
Thanks John

I think when I have less time I'll look into the various shell options because I've used them a hell of a lot in this project. But 1st - error handling me thinks.

Thanks once again :)


-----------------
Cogito Ergo Sum
-----------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top