Specifying the Path to Your Application's Help File

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 display Help for your application, you must specify the path to the Help file that contains the topics you want to display. If you know where Help will be installed for your application, you can hard-code the complete path to the file. However, if the exact path to your Help file isn't known, you must determine a way for your application to find your Help file at run time. The simplest way to do this is to install your application and Help file in the same folder, and then use the Path property of the application that is running to determine what folder the document or database was opened from. For example, this fragment of code uses the ActiveWorkbook property to return the current Excel Workbook object and the Path property to determine its location, and then appends the name of the Help file:

ActiveWorkbook.Path & "\sample.chm"

You can use the Path property the same way by using the ActiveDocument property or the Document object in Word, the ActivePresentation property or the Presentation object in PowerPoint, or the CurrentProject object in Access.

See Also

Adding Help to Your Custom Application | Adding Help to Your Office Application | The Kinds of Help You Can Use | Creating a Help File to Use with an Office Application | Specifying the Path to Your Application's Help File | Displaying Help in Forms and Documents | Displaying Help from Command Bars | Using the Office Assistant to Display Help | Displaying Help from VBA Code