Shell and AppActivate Do Not Work

  • Thread starter Thread starter Chaplain Doug
  • Start date Start date
C

Chaplain Doug

Access 2002. I am experimenting calling up my help file
(SAPHelp.chm) from Access. When I bring up a DOS window
and invoke the help file from the command line (by simply
typing SAPHelp.chm on the DOS command line) it comes up
fine. When I try to do the same thing using Shell
("SAPHelp.chm") or AppActivate I get the error:

Invalid procedure call or argument

Any help.
 
you can also use the HTML Help OCX, either embedded or called:

declare function HTMLHelpL Lib "Hhctrl.ocx" Alias "HtmlHelpA" (ByVal
hwndCaller As Long, ByVal pszFile As String, ByVal uCommand As Long, ByVal
dwData As Long) As Long
 
What are the parameters passed to the HTMLHelpL function?
That is, what hwndCaller, pszFile,uCommand, and dwData?
Thanks.
 
Chaplain Doug said:
Access 2002. I am experimenting calling up my help file
(SAPHelp.chm) from Access. When I bring up a DOS window
and invoke the help file from the command line (by simply
typing SAPHelp.chm on the DOS command line) it comes up
fine. When I try to do the same thing using Shell
("SAPHelp.chm") or AppActivate I get the error:

Invalid procedure call or argument

Any help.

Since your help file isn't an executable file type, I wouldn't expect
Shell or AppActivate to work. But you should be able to use

Application.FollowHyperlink "C:\Your Path\SAPHelp.chm"

or call the ShellExecute API using the code at

http://www.mvps.org/access/api/api0018.htm
 
hwndCaller is a handle to an owner: applicationdesktop, etc
you can probably use application.hWndAccessApp

pszFile is a Pointer to a String which is terminated with a Zero
(that is, it is a normal string passed from access)

UCommand and dwData are zero.

sample:

hwnd = HTMLHelpL(hOwner, GetHTMLHelpFile() + "::/" + strTopic, 0, 0)

see that the file name and topic are joined by ::/

(david)
 
Back
Top