Link to home
Start Free TrialLog in
Avatar of themroc
themroc

asked on

How to point to a specific help topic when invoking a help button vbMsgBoxHelpButton

When a certain contition is fullfiled I fire up a msg box

MsgBox msg_string, vbCritical + vbOKOnly + vbMsgBoxHelpButton, "Warning"

Now my question, there is the button
vbMsgBoxHelpButton
What actually happened when the users presses this button, can someone give me some lines of code
how to invoke a ceratin help ID when the user presses this button

thanks
:)
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Hi themroc,

When I include HTMLHelp with an app, I use this API function to enable the help launch:

Private Declare Function HtmlHelp Lib "HHCtrl.ocx" Alias "HtmlHelpA" (ByVal hwndCaller As Long, _
    ByVal pszFile As String, ByVal uCommand As Long, ByVal dwData As Long) As Long
' Use &HF for uCommand to display a help topic by ContextID (passed as dwData)

I will usually put a commandbutton each form to show help; the click event sub for that button will call
that API function and pass the context ID to show a specific topic.

To do this in a MsgBox:

MsgBox(prompt[, buttons] [, title] [, helpfile, context])

Regards,

Patrick
Avatar of themroc
themroc

ASKER

Hi patrick

I created already a help file and invoke it with
App.HelpFile = "help.chm"

When I want to display help for any topic I only have to assign a help ID and it goes to the right topic.
This I usually do in the property windo for a ceratin control

Now I am not quiet sure where I can set the help ID for the vbMsgBoxHelpButton

Lets say the helpContextID is 661, where do I have to set this number for this button?





MsgBox msg_string, vbCritical + vbOKOnly + vbMsgBoxHelpButton, "Warning"
ASKER CERTIFIED SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of themroc

ASKER

Sorry I was a little bit slow,
it works fine thank you
:)