Accessing Help Topic from Menu Bar

D

Dan Bair

Hi;

I am developing using Office XP Professional. I
purchased a help authoring tool a few months ago called
Visual Help Pro. Seems to work OK, but I'd like to do
something a little different.

In a Access form, you can assign a HelpContextID value.
Then, when you press "F1" the help topic for that
specific form is displayed. This works fine too.

What I'd like to do is have a help button (or something
like that) on my custom toolbar. When it's clicked, have
the help topic for the current form pop up. Just like
pressing the "F1" key. I know how to get the help tree
and index to appear, but that's not really what I want.

Is this going to be real hard? I'm kinda new at this. I
would love any suggestions and/or examples.

Thanks,
Dan
 
D

Dave Jones

Dan,

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
 

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