I have converted WinHelp for my Access app to HTML help (using a tool called HelpScribble) so that my app can run under Vista. The help file opens perfectly independently of Access, so it looks like nothing is wrong with the help file itself, but when i try to open it from within Access using the functions below, only the left-hand pane shows correctly - the right-hand content pane displays "Navigation to the webpage was canceled". This is also true when trying to display any topic on the left-hand side.
Here is the code I used:
Private Const HH_DISPLAY_TOC = &H1
Private Const HH_DISPLAY_INDEX = &H2
Private Const HH_DISPLAY_SEARCH = &H3
' UDT for accessing the Search tab
Private Type tagHH_FTS_QUERY
cbStruct As Long
fUniCodeStrings As Long
pszSearchQuery As String
iProximity As Long
fStemmedSearch As Long
fTitleOnly As Long
fExecute As Long
pszWindow As String
End Type
Private Declare Function HTMLHelpStdCall Lib "hhctrl.ocx" _
Alias "HtmlHelpA" (ByVal hwnd As Long, _
ByVal lpHelpFile As String, _
ByVal wCommand As Long, _
ByVal dwData As Long) As Long
Private Declare Function HTMLHelpCallSearch Lib "hhctrl.ocx" _
Alias "HtmlHelpA" (ByVal hwnd As Long, _
ByVal lpHelpFile As String, _
ByVal wCommand As Long, _
ByRef dwData As tagHH_FTS_QUERY) As Long
Public Function ShowContents() As Long
ShowContents = HTMLHelpStdCall(0, pstrAppProgPath & "MediWiz.chm", HH_DISPLAY_TOC, 0)
End Function
Public Function ShowIndex() As Long
ShowIndex = HTMLHelpStdCall(0, pstrAppProgPath & "MediWiz.chm", HH_DISPLAY_INDEX, 0)
End Function
Public Function ShowSearch() As Long
Dim HH_FTS_QUERY As tagHH_FTS_QUERY
With HH_FTS_QUERY
.cbStruct = Len(HH_FTS_QUERY)
.fUniCodeStrings = 0&
.pszSearchQuery = ""
.iProximity = 0&
.fStemmedSearch = 0&
.fTitleOnly = 0&
.fExecute = 1&
.pszWindow = ""
End With
ShowSearch = HTMLHelpCallSearch(0, pstrAppProgPath & "MediWiz.chm", HH_DISPLAY_SEARCH, HH_FTS_QUERY)
End Function