Dave's Help Topic Code

D

Dan Bair

Hi;

Dave gave me some code to call a help topic from a module
that's activated from the tool bar. It's supposed to get
the current path/directory/filename of my help file and
the helpcontextid of the form that is active and then
display that topic. I'm getting an error message when I
run the code. This is Dave's Code:

--------------------------------------------------------
Place the following function in a module, and then call
it
from the button click event, passing the the full path of
the helpfile and the contextID

Function OpenHelpWithContextID(ByVal strHelpFileName As _
String, lngContextID As Long)

' Opens the Help file to ContextID.

WinHelp Application.hWndAccessApp, ByVal strHelpFileName,
_
HELP_CONTEXT, ByVal lngContextID

End Function

You need to place this constant

Public Const HELP_CONTEXT = &H1

In the general section of the module and this also

Declare Sub WinHelp Lib "user32" Alias _
"WinHelpA" (ByVal hWnd As Long, ByVal lpHelpFile As
String, _
ByVal wCommand As Long, ByVal dwData As Any)

Dave
--------------------------------------------------------

PROBLEM: When I run the module I get this error message:
"The object dosen't contain the Automation
object 'strHelpFileName'.

Hope you're still out there Dave, but I could use some
help from anybody. I'm new and clueless.

Thanks,
Dan
 

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