VB6: Browser Based Help from a button on your form
|You can import the required module mOpenHyperLink from the Access demo
application which you can download from here: msaccess_activating_help.zip
Calling the opening of a html page on a browser is easy. In it's most
primitive form you only need to call the OpenHyperLink procedure as in the
downloaded application module mOpenHyperLink. This in turn will call the
windows API Function
"shell32.dll" , that's all. The code below is optional. It has the
advantage that you don't have to include the full path to your topic page each
time. In addition it shows how to specify the url in case of file server versus
web server, and gives the correct direction of the slash as part of the
- Import module mOpenHyperLink from the downloaded application.
- By default the help opens from the file server. If you want to open from
the Internet, change the line
MyOpenHyperlink strTopicPage As String
, Optional bOnTheInternet As Boolean
, Optional bOnTheInternet As Boolean = True
- In addition, you will need to specify the folder on the web server you will
be using. Replace the http://... part.
strHTMLfilesFolder = "http://helpgenerator.com/help/vb6"
- Open the form you want to add the help button to in View Object
- Add a [Help] button to a form
- Set the button property name to 'cmdHelp'
- Open the form via View Code
- In the left combo box select the button control 'cmdHelp'
Private Sub 'cmdHelp_Click() ... End Sub is inserted
- Insert code so that the result looks like below one of below:
Other ways to call MyOpenHyperlink:
- MyOpenHyperlink "Add_code_to_activate_help.htm"
JsOpenInFrame) is included, it will automatically open the frame page help.htm
so that navigation features are made available.
- MyOpenHyperlink "help.htm?Add_code_to_activate_help.htm"
|The http address is specified in MyOpenHyperlink