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.
Printable View
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.
<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.
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.
I am not sure. I don't think it has anything to do with Shell.
Oh, because I thought maybe it'd be something like this:
Code:Private Sub Image1_Click()
Shell "C:\Program Files\Internet Explorer\IExplore.exe http://www.vb-world.net", vbNormalFocus
End Sub
Thanks very much Matt. It worked.
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:.