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

How do I open a compiled Help File

Status
Not open for further replies.

AccessGuruCarl

Programmer
Jul 3, 2004
471
US
I've created a help file using Microsoft HTML HELP Workshop (compiler for .CHM files)

I've placed a button on the form, but when I try open the help file I get error message Invalid Procedure call or
argument.

Here is the code being used.

Dim stAppName As String

stAppName = "C:\Dev\EDI-Help.chm"
Call Shell(stAppName, 1)

I think I need an API call here, any idea's on how to make this work. Once I get it working I'll replace the default F1 key with this help file.

Thanks in advance,
Carl


AccessGuruCarl
Programmers helping programmers
you can't find a better site.
 
What I got from the Help Help when I was creating a help file is:
Code:
Private Sub CmdHelp_Click()
    Dim strPath As String
    
    ' Get path to current database.
    strPath = CurrentProject.Path
       
    ' Display help for this form in an external tripane window,
    ' using sibling mode.
    Call HTMLHelp(0, strPath & "\help\JrnlHelp.chm" & ">MSO_small", HH_HELP_CONTEXT, ByVal 2010&)
        
End Sub

And

Code:
' Declarations for calling the HtmlHelp API.
' Simplified version of module from HTML Help Authoring Kit.
'
Option Explicit

' Commands to pass to the HtmlHelp function.

Enum HH_COMMAND
    HH_DISPLAY_TOPIC = &H0
    HH_HELP_FINDER = &H0           ' WinHelp equivalent.
    HH_DISPLAY_TOC = &H1           ' Not currently implemented.
    HH_DISPLAY_INDEX = &H2         ' Not currently implemented.
    HH_DISPLAY_SEARCH = &H3        ' Not currently implemented.
    HH_SET_WIN_TYPE = &H4
    HH_GET_WIN_TYPE = &H5
    HH_GET_WIN_HANDLE = &H6
    HH_GET_INFO_TYPES = &H7        ' Not currently implemented.
    HH_SET_INFO_TYPES = &H8        ' Not currently implemented.
    HH_SYNC = &H9
    HH_ADD_NAV_UI = &HA            ' Not currently implemented.
    HH_ADD_BUTTON = &HB            ' Not currently implemented.
    HH_GETBROWSER_APP = &HC        ' Not currently implemented.
    HH_KEYWORD_LOOKUP = &HD
    HH_DISPLAY_TEXT_POPUP = &HE    ' Display string resource ID or text in a pop-up window.
    HH_HELP_CONTEXT = &HF          ' Display mapped numeric value in dwData.
    HH_TP_HELP_CONTEXTMENU = &H10  ' Text pop-up help, same as WinHelp HELP_CONTEXTMENU.
    HH_TP_HELP_WM_HELP = &H11      ' Text pop-up help, same as WinHelp HELP_WM_HELP.
    HH_CLOSE_ALL = &H12            ' Close all windows opened directly or indirectly by the caller.
    HH_ALINK_LOOKUP = &H13         ' ALink version of HH_KEYWORD_LOOKUP.
End Enum

Declare Function HTMLHelp Lib "hhctrl.ocx" Alias "HtmlHelpA" _
    (ByVal hwndCaller As Long, _
    ByVal pszFile As String, _
    ByVal uCommand As HH_COMMAND, _
    dwData As Any) As Long

 
Hello Remou,

I've implemented the code, I'm getting this error message.

HH_HELP_CONTEXT called without a [MAP] section.

Any Idea's


Thanks

AccessGuruCarl
Programmers helping programmers
you can't find a better site.
 
Thanks for the post.

I was able to fix that error using code below.

Call HTMLHelp(0, strPath & "\EDI-Help.chm" & ">MSO_small", HH_DISPLAY_INDEX, ByVal 2010&)


Now I get error for:
The window named "MSO_small" passed to HH_GET_WIN_TYPE as not been specified.

I'll check your link for further details, if you have an idea how to fix, please post.

Thanks again,
Carl

AccessGuruCarl
Programmers helping programmers
you can't find a better site.
 
You may consider 2 alternate ways, either
FollowHyperlink stAppName ' may lunch a security dialog box
or
CreateObject("WScript.Shell").Run stAppName

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks for the post PHV

But I have it working like a charm with the API.



AccessGuruCarl
Programmers helping programmers
you can't find a better site.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top