Microsoft Office 2000/Visual Basic Programmer's Guide |
To display Help for your solution, 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 solution, 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 solution to find your Help file at run time. The simplest way to do this is to install your solution 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.