HelpFile Property

Applies To

CommandBarButton object, CommandBarComboBox object, CommandBarControl object, CommandBarPopup object.

Description

Returns or sets the Help file name for the Help topic attached to the command bar control. Read/write String.

Remarks

To use this property, you must also set the HelpContextID property.

See Also

Help method, HelpContextId property.

Specifics (Microsoft Access)

In Microsoft Access 97, you can use the Toolbar Control Properties dialog box for command bar controls to set the HelpFile property for a control on a command bar. Display the Customize dialog box by pointing to Toolbars on the View menu and clicking Customize. For menu bar and toolbar controls, display the menu bar or toolbar, and then right-click the control whose HelpFile property you want to set. For shortcut menu controls, select the Shortcut Menus check box on the Toolbars tab of the Customize dialog box, then find the shortcut menu control you want on the menu bar that's displayed and right-click the control. Click the Properties command. Enter the name of the Help file you want in the Help File box.

Example

This example adds a custom report manager button to the File menu and specifies a Help topic to be displayed as that button's context-sensitive Help.

Set fileMenu = CommandBars _
    .FindControl(Type:=msoControlPopup, Id:=fileId)
Set fileMenuDropdown = fileMenu.CommandBar
Set newbutton = fileMenuDropdown.Controls _
    .Add(Type:=msoControlButton, Id:=customId, Before:=3)
With newButton
    .Caption = "Open Report"
    .DescriptionText = "Opens a quarterly report form"
    .OnAction = "ReportManager"
    .HelpFile = "C:\corphelp\custom.hlp"
    .HelpContextID = 47
End With