Microsoft Office 2000/Visual Basic Programmer's Guide |
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 about how to do this, search the Microsoft Word Visual Basic Reference Help index for "Help method."