Shell and AppActivate Do Not Work

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.
 
D

david epsom dot com dot au

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
 
G

Guest

What are the parameters passed to the HTMLHelpL function?
That is, what hwndCaller, pszFile,uCommand, and dwData?
Thanks.
 
D

Dirk Goldgar

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
 
D

david epsom dot com dot au

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top