Microsoft Office 2000/Visual Basic Programmer's Guide |
To display Help topics in Office solutions by using standard properties or the Help method of the Application object, your compiled Help file must have a numeric value, called a context ID, for each topic you want to display. This is true for both context-sensitive Help and standard Help topics, and whether you are using a compiled HTML Help file or a WinHelp 4.0 file.
For WinHelp 4.0 files, the process of mapping context IDs is the same for both context-sensitive pop-up Help and standard Help topics.
To create and map context IDs in a WinHelp 4.0 Help file
For more information about creating WinHelp files, see the Help system in Microsoft Help Workshop.
In Office applications, HTML Help files can be used only for standard Help topics, and the process of mapping context IDs in HTML Help files is different than that used for WinHelp 4.0 files. In HTML Help, Help topics that will be displayed in the HTML Help Viewer or a Help window are authored by using a separate HTML file for each topic. After you have authored your Help topics, you will want to create jumps between them. To do this, instead of using a topic ID to specify the topic to jump to as is done for WinHelp 4.0 files, you author a standard HTML hyperlink that specifies the HTML file name of the topic. For example, the following <A> (anchor) tag creates a jump to the topic authored in the Options.htm file:
<A HREF="Options.htm">Options</A>
To retain compatibility with applications that expect context IDs, HTML Help requires you to perform two steps to create numeric context IDs for each topic file you want to display:
The following procedures assume you have already created Help topics for your HTML Help file.
To create a C-style header file to map topic IDs to context IDs
#define topic_id nnnn // comment
The string constant after #define is the topic ID and the number following it is the context ID. Each topic ID and context ID must be unique within your Help project. The "//" comment introducer and comment text are optional.
After you have created your header file and specified it for your Help project file, you must alias each of the topic ID strings in the header file. You can do this manually or by including a text file that defines each alias. Before doing this, you should print out or open a copy of the map header file you created in the previous procedure so that you can view the names of each topic ID string.
To manually alias topic IDs to context IDs
To alias topic IDs to context IDs by using a text file
topic_id=filename.htm ; comment
The topic_id string constant is the topic ID from the mapping header file, and the file name following the equal sign (=) is the HTML file name of the topic you want to display. The ";" comment introducer and comment text that follows are optional.
Once you have mapped context IDs to the topic IDs in your compiled WinHelp 4.0 and HTML Help files, you use the appropriate context IDs in the design-time settings of forms and controls, and in your program code to display the correct Help topic.
For more information about creating HTML Help files, see the Help system in HTML Help Workshop.