This is a start. For context sensitive help at control level, you are on your own.
[/code]
Private Form_Load
HTMLHelp.WindowHandle = Me.hWnd
HTMLHelp.Filename = wParms.objFS.BuildPath(App.Path, "VBCompare.chm"

End Sub
Private Sub MnuHelpTopics_Click()
HTMLHelp.DisplayTopic "CompareForm.HTM"
End Sub
'Public Module
Option Explicit
Const HH_DISPLAY_TOPIC = &H0
Const HH_SET_WIN_TYPE = &H4
Const HH_GET_WIN_TYPE = &H5
Const HH_GET_WIN_HANDLE = &H6
Const HH_DISPLAY_TEXT_POPUP = &HE ' Display string resource ID or
' text in a pop-up window.
Const HH_HELP_CONTEXT = &HF ' Display mapped numeric value in
' dwData.
Const HH_TP_HELP_CONTEXTMENU = &H10 ' Text pop-up help, similar to
' WinHelp's HELP_CONTEXTMENU.
Const HH_TP_HELP_WM_HELP = &H11 ' text pop-up help, similar to
' WinHelp's HELP_WM_HELP.
Public WindowHandle As Long
Public Filename As String
Declare Function HTMLHelp Lib "hhctrl.ocx" Alias "HtmlHelpA" _
(ByVal hwndCaller As Long, ByVal pszFile As String, _
ByVal uCommand As Long, ByVal dwData As Long) As Long
Public Sub DisplayContents()
' HTML Help file launched in response to a button click:
'hWnd is a Long defined elsewhere to be the window handle
'that will be the parent to the help window.
Dim hwndHelp As Long
Dim strResponse As String
'The return value is the window handle of the created help window.
On Error Resume Next
hwndHelp = HTMLHelp(WindowHandle, Filename, HH_DISPLAY_TOPIC, 0)
If Err.Number <> 0 Then strResponse = Err.Description
On Error GoTo 0
If hwndHelp = 0 Or Len(strResponse) > 0 Then
NoHelp strResponse
End If
End Sub
Public Sub DisplayTopic(strTopic As String)
' HTML Help file launched in response to a button click:
'hWnd is a Long defined elsewhere to be the window handle
'that will be the parent to the help window.
Dim hwndHelp As Long
Dim strResponse As String
'The return value is the window handle of the created help window.
On Error Resume Next
hwndHelp = HTMLHelp(WindowHandle, Filename & "::/" & strTopic, HH_DISPLAY_TOPIC, 0)
If Err.Number <> 0 Then strResponse = Err.Description
On Error GoTo 0
If hwndHelp = 0 Or Len(strResponse) > 0 Then
NoHelp strResponse
End If
End Sub
' A specific topic identified by the variable ContextID is launched
' in response to this button click:
Public Sub DisplayContext(lngContextId As Long)
Dim hwndHelp As Long
Dim strResponse As String
'The return value is the window handle of the created help window.
On Error Resume Next
hwndHelp = HTMLHelp(WindowHandle, Filename, HH_HELP_CONTEXT, lngContextId)
If Err.Number <> 0 Then strResponse = Err.Description
On Error GoTo 0
If hwndHelp = 0 Or Len(strResponse) > 0 Then
NoHelp strResponse
End If
End Sub
Private Sub NoHelp(strErr As String)
Dim strResponse As String
Dim objW As Object
If Len(strErr) = 0 Then
On Error Resume Next
Set objW = wParms.objFS.GetFile(Filename)
If Err.Number <> 0 Then strResponse = Err.Description
If Len(strResponse) > 0 Then
strResponse = strResponse & vbCrlf & "Help File=" & Filename
End If
On Error GoTo 0
Else
strResponse = strErr
End If
If Len(strResponse) = 0 Then
strResponse = strErr & vbCrlf
strResponse = strResponse & "Help File=" & Filename & vbCrlf
strResponse = strResponse & "Unable to start HTML Help." & vbCrlf
strResponse = strResponse & "You must have at least IE 4.01 and the HTML Help Viewer installed." & vbCrlf
strResponse = strResponse & "Download HHUPD.EXE from Microsoft to intall the HTML Help Viewer."
End If
If Len(strResponse) > 0 Then
MsgBox strResponse, vbQuestion + vbOKOnly, "HTML Help File"
End If
End Sub
[/code]