Share via


Displaying Help by Using the Help Method

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.

The Help method of the Application object can be used from Excel and PowerPoint to display a custom Help topic. You can invoke the Help method from practically any context, but it is most commonly used to display a Help topic from a command button or from a menu item or toolbar button. You use the following syntax to call the Help method:

expression.Help(HelpFile, HelpContextID)

where expression returns an Application object, HelpFile is the name of either a .chm or .hlp file, and HelpContextID is the context ID of the topic you want to display. The HelpFile argument must include the full path to the file.

For example, the following code fragment opens the Help file Sample.chm in the current folder of the active Excel workbook and displays the topic mapped to context ID 2001:

Application.Help (ActiveWorkbook.Path & "\sample.chm", 2001)

While you can't display a custom Help topic by using the Help method of the Application object in Word, you can use it to display built-in Help. For more information see, the Microsoft Word Visual Basic Reference Help index for Help Method.

See Also

Displaying Help from VBA Code | Displaying Help by Using the HtmlHelp API | Displaying Help by Using the InputBox and MsgBox Functions | Displaying Help for Custom Error Messages | Displaying Help for Properties and Methods in Class Modules