Click to See Complete Forum and Search --> : web link


midnightservice
September 15th, 2001, 11:03 PM
how do i add a html link to a menu control...for contact info in the help section on a menu...i have seen other apps use this function but i cant seem to find out how to do this....

thanx in advance

midnightservice

Cakkie
September 16th, 2001, 04:18 PM
You can use The ShellExecute API for this

private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (byval hwnd as Long, byval lpOperation as string, byval lpFile as string, byval lpParameters as string, byval lpDirectory as string, byval nShowCmd as Long) as Long

private Sub Command1_Click()

ShellExecute me.hwnd, "open", "http://www.codeguru.com", "", "", 0

End Sub




Tom Cannaerts
slisse@planetinternet.be

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook

tobeyu
September 16th, 2001, 06:31 PM
Or you could simply use the Shell function in VB:


Shell "C:\Program Files\Internet Explorer\iexplore.exe http://www.microsoft.com", vbNormalFocus

Cakkie
September 17th, 2001, 01:00 AM
Only if that's the path to internet explorer. Using ShellExecute, you will always use the default browser (could be Netscape or Opera as well), and don't have to worry about the path.

Tom Cannaerts
slisse@planetinternet.be

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook

JJim
September 17th, 2001, 09:34 AM
Great, I was just looking for that.

Regards,

Jim Jackson

cappy2112
September 23rd, 2004, 07:37 PM
[QUOTE=Cakkie]You can use The ShellExecute API for this

private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (byval hwnd as Long, byval lpOperation as string, byval lpFile as string, byval lpParameters as string, byval lpDirectory as string, byval nShowCmd as Long) as Long

private Sub Command1_Click()

ShellExecute me.hwnd, "open", "http://www.codeguru.com", "", "", 0

End Sub

Cakkie-

Using this code, How do I make a clickable link on a form ?
I would like the Link to work just like on an HTML page- that is, when the use clicks the link on the form, it launches a web browser to the URL.

cancer10
September 24th, 2004, 12:12 AM
Or you could simply use the Shell function in VB:


Shell "C:\Program Files\Internet Explorer\iexplore.exe http://www.microsoft.com (http://www.microsoft.com/)", vbNormalFocus
Well, officially this will not work because if the end user is using Drive D: as his/her primary drive then it will face problems.


Shell ("start http://www.helloindia.tk") would rather work :)


also u can follow wot cappy suggested.