We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now


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

themroc asked
Medium Priority
Last Modified: 2010-04-07
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
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

Watch Question

Top Expert 2010

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])




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"
Top Expert 2010
It's the fifth argument.  See the syntax I posted above.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts


Sorry I was a little bit slow,
it works fine thank you
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.