Open a .CHM file to a Specific Topic?

This can be achieved by the following steps:

  1. Identify what names the chm uses to refer the internal topics. This is done by

    • Open the CHM file, and right click in the topic page and select Properties.
    • The property called: Address (URL) Contains the topic page name at its end.

    Here is an example:

    mk:@MSITStore:C:\Program%20Files\Silsila%2011\Silsila.chm::/Audio.htm
    

    Here the topic page name is "Audio.htm"

  2. Call the Help.ShowHelp() function with the correct parameters as shown below

    Help.ShowHelp(this, "./Resources/Silsila.chm", HelpNavigator.Topic, "Audio.htm");
    

That should do it. you can fine the topic name of the pages you want using Step 1, and then use Step 2 to open the help file on that page.


The same also works to create a windows shortcut opening a specific page. Use that as "target" command line :

C:\Windows\hh.exe ms-its:[file_name.chm]::[page_name.htm]

If you do not know [page_name]: from the chm help viewer, try to print the target page on a virtual printer like PdfCreator. The output filename automaticaly generated will probably contain [page_mane].

With thanks to sazr for the intial syntax !

Tags:

C#

Chm

Helpfile