Help with MS Function

D

Dan Bair

Hi;

I'm still trying to run some code that opens my help file
from a module. I'm getting the following message:

"Microsoft Access can't find the
name '<<strHelpFileName>>' you entered in the expression.

The code in the module was given to me by Dave and looks
like this:
--------------------------------------------------------
Option Compare Database
Public Const HELP_CONTEXT = &H1
Declare Sub WinHelp Lib "user32" _
Alias "WinHelpA" ( _
ByVal hWnd As Long, _
ByVal lpHelpFile As String, _
ByVal wCommand As Long, _
ByVal dwData As Any)

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

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

End Function
-------------------------------------------------------

I am executing this code from a macro. I would like to
have 'strHelpFileName' contain "Project.hlp" and
lngContextID = 1000, but I'm not sure where to assign
these values in the code.

Help,
Dan
 
D

Dan Artuso

Hi,
Just call it like this:

OpenHelpWithContextID "C:\Documents and Settings\artusod\Desktop\outlook help\VBAOUTL.HLP",1000

You have to include the full path to your help file.
Of course I get, 'Topic doesn't exist' but presumably 1000 means something to your
help file.
 
D

Dan Bair

Thanks for responding so quickly Dan, hope you're still
out there.

Does this code go in a module that is called by a macro?
If so, is the function name
called "OpenHelpWithContextID"?

I'm trying to execute this from a custom toolbar. The
toolbar allows me to execute a macro. The macro requires
a function. I don't know squat about functions, but when
I try to execute something like:

Funtion OpenHelpWithContextID "C:\.......Project.hlp",1000

I get a compile error. How's it supposed to look?

Thanks again,
Dan
-----Original Message-----
Hi,
Just call it like this:

OpenHelpWithContextID "C:\Documents and
Settings\artusod\Desktop\outlook help\VBAOUTL.HLP",1000
You have to include the full path to your help file.
Of course I get, 'Topic doesn't exist' but presumably 1000 means something to your
help file.

--
HTH
Dan Artuso, Access MVP


"Dan Bair" <[email protected]> wrote
in message news:[email protected]...
 
D

Dan Artuso

Hi,
If you're running it from a macro, just enter it in the Function Name text box:
OpenHelpWithContextID("C:\Documents and Settings\artusod.LISE\Desktop\outlook help\VBAOUTL.HLP",1000)
 
D

Dan Bair

Thanks again Dan.

What are my other options... other than a macro. I still
want to run it from the toolbar. Could I put the code in
a form and make the form invisible. Can you somehow just
run code from the toolbar?
-----Original Message-----
Hi,
If you're running it from a macro, just enter it in the Function Name text box:
OpenHelpWithContextID("C:\Documents and Settings\artusod.LISE\Desktop\outlook
help\VBAOUTL.HLP",1000)

--
HTH
Dan Artuso, Access MVP


"Dan Bair" <[email protected]> wrote
in message news:[email protected]...
 
D

Dan Artuso

Hi,
Nothing wrong with using a macro, in fact I couldn't get it to work by calling
the function directly from the button click.
 

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