BUG: HTML Help does not correctly merge the .chm files (311151)



The information in this article applies to:

  • Microsoft HTML Help 1.2
  • Microsoft HTML Help 1.21
  • Microsoft HTML Help 1.22
  • Microsoft HTML Help 1.3
  • Microsoft HTML Help 1.31
  • Microsoft HTML Help 1.32

This article was previously published under Q311151

SYMPTOMS

When you merge .chm files by using Microsoft HTML Help Workshop, one or more of the following problems may occur:
  • The topic files do not merge.
  • The index files do not merge.
  • The table of content files do not merge.
  • The table of content files merge, but the titles and topics are not indented correctly.

CAUSE

These problems may occur when one or more of the following are true:
  • At least one of the indexes is not a binary index.
  • The parent index does not contain at least one keyword.
  • The file and path names of any one of the .chm files contains periods or spaces.
  • The table of contents file in the parent .chm file contains additional <UL> tags.
  • The child .chm file is not in the folder of the parent .chm file.
Some of these problems are caused by bugs, and some are caused by limitations in the Microsoft HTML Help compiler.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

Use the following list to troubleshoot possible merge problems:
  • Include the child .chm files that are to be merged into the parent .chm file in the [MERGE FILES] section of the parent .chm file. To do this, double-click the [OPTIONS] section, and then click the Merge Files tab. Make sure the child .chm files are listed. If the files are not listed, click Add to add them.
  • Make sure that the index of the parent .chm file contains at least one keyword. The indexes of the child .chm files are automatically included if there is at least one keyword in the index of the parent .chm file.
  • Make sure that all the parent and child indexes are binary indexes. To do this, double-click the [OPTIONS] section, click Compiler, and then click to select the Create a binary index check box for each child .hhp file and for the parent .hhp file.
  • Make sure none of the .chm files have names or paths that contain spaces or periods.
  • Check the table of contents. The following example shows how the merged topics should be included:
    INCLUDE: childchm.chm::\childchm.hhc
    						
    To add a child .hhc file to a parent .chm file, right-click the table of contents where you want to add the file, and then click Insert File. Type the .chm file name, and type the .hhc file name. To add the .hhc file name, use this code, but do not type INCLUDE. This is added automatically. When the HTML Help Workshop tells you that it cannot find the file, click Yes to add the file.
  • When you open the parent .chm file, make sure that the child .chm file is also in the folder.

    Note The merge operation only generates the links that refer to the target .chm file. It does not copy the links into the project. Therefore, if you remove the child .chm file, you do not see the index and keywords of the child .chm file.
  • Because of a known bug, the table of contents files merge, but the topics are not indented correctly. For example, the table of contents looks similar to the following:
    Mybook
      Chapter 1
          Chapter 2
              Chapter 3
    The table of contents should look similar to the following:
    Mybook
      Chapter 1
      Chapter 2
      Chapter 3
    To work around this bug, change the parent .hhc file in Notepad. To do this, remove all the additional <UL> and </UL> tags, save the .hhc file, and then recompile the parent .chm file.

REFERENCES

For more information about merging HTML Help files, see the "Merging help files at run time" Help topic in Microsoft HTML Help Workshop.

Modification Type:MajorLast Reviewed:8/3/2004
Keywords:kbmerge kbhelpfile kbbug KB311151 kbAudDeveloper