oostwijk
asked on
simple question
how can I load an html page named help.html in a browser window when I press a button named Help_btn in my visual basic program ?
Private Sub Help_btn_Click()
Ret& = ShellExecute(0, "open", "www.google.com", "", vbNull, SW_SHOWNORMAL)
End Sub
Rajesh
Ret& = ShellExecute(0, "open", "www.google.com", "", vbNull, SW_SHOWNORMAL)
End Sub
Rajesh
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Rajesh,
It works fine when I use the line :
Ret& = ShellExecute(0, "open", "www.google.com", "", vbNull, SW_SHOWNORMAL)
However when I want to open a offline html page with:
Ret& = ShellExecute(0, "open", "help.html", "", vbNull, SW_SHOWNORMAL)
it doesn't work..
Can you help me out ?
It works fine when I use the line :
Ret& = ShellExecute(0, "open", "www.google.com", "", vbNull, SW_SHOWNORMAL)
However when I want to open a offline html page with:
Ret& = ShellExecute(0, "open", "help.html", "", vbNull, SW_SHOWNORMAL)
it doesn't work..
Can you help me out ?
give the full path:
Ret& = ShellExecute(0, "open", "c:\html\help.html", "", vbNull, SW_SHOWNORMAL)
Rajesh
Ret& = ShellExecute(0, "open", "c:\html\help.html", "", vbNull, SW_SHOWNORMAL)
Rajesh
Maybe you have to use the file protocol , like this
Ret& = ShellExecute(0, "open", "file://c:\html\help.html" , "", vbNull, SW_SHOWNORMAL)
Ret& = ShellExecute(0, "open", "file://c:\html\help.html"
If you prefer to have programmatic control over the process rather than just shelling out (so that you can get better error information, for example), you could do this instead:
Dim oIE As Object
Set oIE = CreateObject("SHDocVw.Inte rnetExplor er")
oIE.Visible = True
oIE.Navigate "http://www.sysinternals.com/"
Set oIE = Nothing
If you prefer to use early binding, the TypeLib to Reference in VB is called "Microsoft Internet Controls".
Dim oIE As Object
Set oIE = CreateObject("SHDocVw.Inte
oIE.Visible = True
oIE.Navigate "http://www.sysinternals.com/"
Set oIE = Nothing
If you prefer to use early binding, the TypeLib to Reference in VB is called "Microsoft Internet Controls".
Ret& = ShellExecute(0, "open", "c:\help.htm", "", vbNull, SW_SHOWNORMAL)
or
Ret& = ShellExecute(0, "open", "www.google.com", "", vbNull, SW_SHOWNORMAL)