MOD2000: How to Create Context Sensitive HTML Help Files
ID: Q242433
|
The information in this article applies to:
-
Microsoft Office 2000 Developer
SUMMARY
In HTML Help Workshop, which is included in Microsoft Office 2000 Developer, you can create Help files in compressed HTML (.chm). This is a significant change from the Help workshop that is included in Microsoft Office 97 Developer Edition. Help Workshop in Microsoft Office 97 Developer Edition creates Winhelp files (.hlp).
This article demonstrates how to create a simple HTML Help file in HTML Help Workshop, and then how to use the Help file in a Microsoft Access form. The Help file uses context IDs to show different Help topics, depending on where you click the pointer in the form.
Creating this simple HTML Help file involves completing the following topics:
-
Creating two HTML files: one for the form and one for the control.
-
Creating a map file to define the context IDs.
-
Creating an alias file that associates each topic ID with a topic.
-
Compiling these files in HTML Help Workshop into a single compressed HTML file (*.chm).
-
Adding the path to the HelpFile property of a sample form.
-
Assigning context IDs to the form and to a control on the form.
-
Testing the form.
The result is a form on which you can press F1 while in a particular text box to get a particular Help topic. Pressing F1 anywhere else on the form displays the general form Help topic.
MORE INFORMATION
To create a compressed HTML file with context sensitive Help, follow these steps:
Creating the HTML Files
-
Click Start, point to Programs, point to HTML Help Workshop, and then click HTML Help Workshop.
-
On the File menu, click New. Click Project, and then click OK. Name the new project MyProject.
-
On the File menu, click New.
-
Click HTML File, and then click OK.
-
In the HTML Title dialog box, type Form Help, and then click OK.
-
Between the <BODY> tags, type This is the Help topic for the form.
-
On the File menu, click Save File. The Save As dialog box appears.
-
Save the file with the name Test1.htm.
Make note of the folder where you saved this file.
-
Close the Test1.htm file.
-
On the File menu, click New.
-
Click HTML File, and then click OK.
-
In the HTML Title dialog box, type Control Help, and then click OK.
-
Between the <BODY> tags, type This is the Help topic for the control.
-
On the File menu, click Save File. The Save As dialog box appears.
-
Save the file with the name Test2.htm.
Make note of the folder where you saved the file.
Creating the Map File
-
Click the Add/Remove topic files button. It is the second button down on the Project tab.
-
Add the two files that you created earlier: Test1.htm and Test2.htm.
-
Click Start, and then click Run.
-
In the Open box, type Notepad, and then click OK.
-
In Notepad, type the following lines:
#define 1 1001
#define 2 2001
-
On the File menu, click Save as.
-
In the Save as type box, change the type to All Files.
-
Type the file name Map.h, and then click Save.
Creating the Alias File
-
In Notepad, click New on the File menu.
-
Type the following lines:
1=test1.htm;
2=test2.htm;
-
On the File menu, click Save as.
-
In the Save as type box, change the type to All Files.
-
Type the file name Alias.h, and then click Save.
Compiling a Single Compressed HTML File
-
In HTML Help Workshop, click the button for the HTMLHelp API Interface. This is the fourth button down on the left side of the Project tab.
-
On the Map tab, click Header File.
-
Click Browse, and then browse to the Map.h file that you created earlier in Notepad.
-
Highlight Map.h, and then click Open. Note that you see #include Map.h in the list.
-
Click the Alias tab, and then click Include.
-
Click Browse, and browse to the Alias.h file that you created earlier in Notepad.
-
Highlight Alias.h, and then click Open. Note that you see #include Alias.h in the list.
-
Click OK.
-
On the File menu, click Compile.
- Compile the Help file as MyProject.
-
Verify that the MyProject.chm file has been created and make note of its location.
Adding the Path
-
In Access, create a new database named Database1.mdb. Create it in the same location where you created the Help file.
-
In the Database1.mdb file, create the following form:
Form: Test1
-----------------
Caption: TestForm
Text Box
------------
Name: Field1
Text Box
------------
Name: Field2
-
In Design view, click the form, and then on the View menu, click Properties.
-
Click the Other tab.
-
Set the HelpFile property to MyProject.chm.
Assigning Context IDs
-
Set the HelpContextId property of the form to 1001, and then click OK.
-
Select the Field2 control, and then on the View menu, click Properties.
-
Click the Other tab.
-
Set the HelpContextId property of the Field2 control
to 2001. Press ENTER.
Testing the Form
-
On the View menu, click Form View.
-
Click the Field1 control, and then press F1. Note that the topic for the form appears. This is because the Field1 control does not have an associated topic and therefore defaults to the general form topic.
-
Close the Help topic.
-
Click the Field2 control, and then press F1. Note that the topic for the Field2 control appears.
REFERENCES
For more information about creating header files, in HTML Help Workshop, click Help Topics on the Help menu, type header files on the Search tab, and then click List Topics to view the topics returned.
Additional query words:
Keywords : kbdta
Version : :
Platform :
Issue type : kbhowto
|