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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

displaying hyperlink in form/controls

Status
Not open for further replies.

getimran

Programmer
Aug 23, 2001
64
ES
hie,

how can i hyperlink my form so it opens default browser/ IE for and display webpage.

bye
 
Hi,
Could you try this and let me know if it works please

' Inside a BAS Module.

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

Public Sub StartProgram(ByVal strFileName As String)
Const SW_NORMAL = 1
ShellExecute 0, "open", strFileName, vbNullString, vbNullString, SW_NORMAL
End Sub


Usage:

StartProgram " 'Start Web site.

StartProgram "C:\Windows\notepad.exe" 'Start Notepad.

StartProgram "C:\Windows\Help\Windows.hlp" 'Start Help file.

StartProgram "C:\Windows\Help\WAB.CHM" 'Start HTML Help.

Hope this helps
Good luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top