Share via


Displaying Context-Sensitive Help for Command Bar Controls

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

To implement context-sensitive Help for a command bar control, you set the control's HelpFile property to the name of the Help file that contains the context-sensitive Help topic, and set the HelpContextID property to the context ID of the topic you want to display. There is no need to do this for built-in command bar controls used in custom command bars because they already have context-sensitive Help topics associated with them.

In all Office applications, you can set the HelpFile and HelpContextID properties by using VBA code. In Access, you can also set these properties through the user interface by clicking Customize on the Tools menu. The following code fragment sets these properties for a command bar control:

With ctlCBarControl
   .Caption = "M&y Help"
   .BeginGroup = True
   .FaceId = 0
   .OnAction = "DisplayHelp"
   .HelpFile = strAppPath & "\samplepopups.hlp"
   .HelpContextID = 1004
   .Visible = True
End With

See Also

Displaying Help from Command Bars | Displaying a Standard Help Topic from a Toolbar Button or Menu Item