PDA

Click to See Complete Forum and Search --> : Linking URL to an image control


grrs
Dec 5th, 2000, 08:37 AM
Hi Guys,

New to VB. I would to link a URL to an image control. When user clicks on image it needs to open that(linked) web page. Can anybody help me in writing this code.

Thanks for your help.

Dec 5th, 2000, 08:43 AM
<a href="http://www.vb-world.net"><IMG SRC="http://www.vb-world.net/images/vbworld.gif"></a>

And if you want the link to go somewhere else, set the target.

<a href="http://www.vb-world.net" target="_blank"><IMG SRC="http://www.vb-world.net/images/vbworld.gif"></a>

^This will open it in a new window.

grrs
Dec 5th, 2000, 08:49 AM
I am not trying to open that link from a web browser. I got an VBA application wizard where I put the image control. When I click that image it needs to open the web browser and go to that url address.

grrs
Dec 5th, 2000, 12:02 PM
I am not sure. I don't think it has anything to do with Shell.

Dec 5th, 2000, 12:39 PM
Oh, because I thought maybe it'd be something like this:

Private Sub Image1_Click()
Shell "C:\Program Files\Internet Explorer\IExplore.exe http://www.vb-world.net", vbNormalFocus
End Sub

grrs
Dec 5th, 2000, 01:24 PM
Thanks very much Matt. It worked.

Dec 5th, 2000, 07:40 PM
Wow, I just guessed :rolleyes:.
I figured VBA would have the Shell function :).
And Image1_Click..also a guess. Didn't know that was there.

I remember seeing VBA at school though. Didn't know how to work it though. I guess I'll ask my teacher and hope she knows. She probably doesn't, but than again, a lot of teacher's teach computer classes and don't know sh*t about computers :rolleyes:.