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

help on creating a "html help file"

Status
Not open for further replies.

devinci

MIS
Feb 15, 2002
46
CA
i need help creating a html help file to add to my program. do i need to create a simple html file or files and then link does to the prog. or do i need to convert them into .chm files to link to the prog.

thankx
 
One method to contemplate, if you are not concerned about your help being context sensitive is to use the ShellExecute API to launch an HTML page from your VB app. I have typically placed the name and path of the html page in an ini file (or in the registry) just in case I later wish to change it. This method allows me (or even the user) to update the help files quickly and easily after the application has been released.

The page that is launched is typically laid out as a Table of Contents where references (links to other pages) can easily be added, deleted or modified. Users seem to enjoy this method as they can even add their own Tips and How To Do’s after the application has been released.


If this method is of interest I have placed some sample code:

----------------------INI FILE ---------------------
This assumes you have an ini file called AppName.ini
Minimum contents of the ini file would be:

[Help Documentation]
Help_Location=C:\SomePath\Help_Start.htm
-----------------------------------------------------

-------------------- VB App -------------------------
------ Cut and paste the following into VB form -----

'This is the API to launch other programs / files
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

'This is the API to read an ini file
Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long


Private Sub mnuHelpDocs_Click()
Dim Temp As String * 300
Dim ReadLine As Integer
Dim HelpDoc As String
Dim MyIni As String

'Get Help File Name and Path from INI File
MyIni = App.Path & "\AppName.ini"
ReadLine = GetPrivateProfileString("Help Documentation", "Help_Location", App.Path & "\Help_Start.htm", Temp, Len(Temp), MyIni)
HelpDoc = Left$(Temp, Len(Temp))

'Launch the Help File
ShellExecute hwnd, "open", HelpDoc, vbNullString, vbNullString, conSwNormal
End Sub

--------------------------------------------------------
 
thanks for the help ....... just what i was looking for
 
See also faq222-1111 Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top