Show Sitemap ..Help2HTMLHelpWinHelp

HTMLHelp - Linking

HTML Help 1.x does not have the capability of delivering compressed help over http. You can point to a .chm on the user's local drive, and you can link to a .chm for download, but that's as far as it goes. This feature has been tentatively planned for future versions, as there have been many requests for it.

It has to be assumed this functionality will not released any more, because of the development of Windows Vista AP Help.

The ability to look inside an ITS (CHM) file is something unique to Microsoft Internet Explorer only. Only IE could load a locally path like:


Copy the path above and set your %WINDIR% to test it.

Java Script


This will fail under SP2 * Now Fail *

<a href="JavaScript:window.showHelp('ms-its:joy.chm::/cpl_joy_overview.htm')">Help</a>

Link to a CHM file - Page pulled into Browser:

Full path to CHM - ** OK ** This will fail under SP2 * Now Fail *

BUT... This fails from inside a CHM file.

Link to a topic in a CHM on the web - ** OK ** This will fail under SP2 * Now Fail *
<A HREF="ms-its:">Link to a topic in a .chm</a>
Link to a topic in a .chm


Standard Link to a CHM file - Download Dialog

Without the ms-its: prefix your browser will try and download the CHM file with the standard "Open or Save" question.

Is there anyway to avoid the open/save dialog?

Not really...CHMs weren't designed to be opened via the web over http. Instead, you should use one of the available "web-help" applications. Microsoft has a free JavaScript one, but it's not very good and doesn't support all the features of CHMs. The ones from authoring tools (RoboHelp, for instance) are much better.

There _is_ a roundabout way to do it - but it has limitations and there's no guarantee that it still works or will continue to work. For more information see:

Linking to PDF

1) Use following syntax in your HHC file:
<LI><OBJECT type="text/sitemap">
<param name="Name" value="Link PDF from CHM">
<param name="Local"
<param name="WindowName" value="main">

2) Use a shortcut control like the one below to open the PDF in the
associated application (e.g., Acrobat or the Acrobat Reader).

<object classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<param name="Command" value="ShortCut">
<param name="Button" value="Text:Click Here">
<param name="Item1" value=",sample.pdf,">

The attached tutorial offers a method of linking to a PDF from a CHM file.
It explains how to effectively "SHELL" a Windows program to which you only
know the RELATIVE path from your CHM file

This is an FAQ that I see regularly, but as yet I have not seen my method
offered as a solution. The method uses a PDF as the example, but it can work
just as well for other types of shortcut.

I will be cross-posting this tutorial to a number of HTMLHelp groups.

Comments appreciated.

Jeff Hall MSc ARICS, Eon Commerce Ltd.
Microsoft HTML Help MVP

EasyHTMLHelp: CHM file Editor for MS Word 97/2000
Latest Version = 1.1 Build 26 - March 26 2001

If you would like to join (or unsubscribe) the automated
mailing list then go to

From: Jeff Hall HTMLHelp MVP
Subject: Linking to an external PDF file from a CHM


The HTMLHelp workshop allows you to create an "ActiveX Shortcut" command
that enables you to link from a CHM file to an EXTERNAL file such as a PDF.

Normally you would place the PDF in the same folder location as the CHM file,
or alternatively in a known RELATIVE path.

However, the PDF shortcut does not always display: sometimes generating a
"file not found" message.


The CHM file assumes the current DEFAULT directory for shortcuts.
This may be different to the location of the CHM file folder.


It is possible to read the CHM location from any page inside a CHM file.
By using Javascript to read this location and write the shortcut, the external
file can be called using its ABSOLUTE path.

This is a robust method of solving this problem.


<TITLE> - robust method of calling an external PDF from a

//Create the chmfile object for this HTML page
var chmfile = new Object();
chmfile.fullname = ""; = "";
chmfile.path = ""; = "";

//Get the path and name of the CHM file and assign object values
function getchmfile(){
var ra, sl, a, X, Y, Z;
ra = /:/;
a =;
sl = "::";
Y = location.href.lastIndexOf(sl);
if (a == 4) { // file: or http:
Y = location.href.lastIndexOf("/"); = unescape(location.href.substring(Y+1));
if(location.href.substring(0,4) == "file"){
chmfile.path = unescape(location.href.substring(8, Y+1));
else {
if (a == 2) X = 14; // mk:@MSITStore:
if (a == 7) X = 7; // ms-its:
chmfile.fullname = unescape(location.href.substring(X, Y));
Z = chmfile.fullname.lastIndexOf("\\");
chmfile.path = unescape(chmfile.fullname.substring(0, Z+1)); = unescape(chmfile.fullname.substring(Z+1)); = unescape(location.href.substring(Y+3));


//Write a Shortcut Button in JavaScript
var relativepath="pdffiles\\mypdf.PDF";

document.write('<OBJECT id=ShortCutButton type="application/x-oleobject"');
document.write(' classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"');
document.write(' codebase="hhctrl.ocx"');
document.write(' >');
document.write(' <PARAM name="Command" value="ShortCut">');
document.write(' <PARAM name="Button" value="Text:Click This Button">');
document.write(' <PARAM name="Item1"

//Write a Hidden Shortcut Link Object in JavaScript
var relativepath2="pdffiles\\myotherpdf.PDF";

document.write('<OBJECT id=ShortCutLink type="application/x-oleobject"');
document.write(' classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"');
document.write(' codebase="hhctrl.ocx"');
document.write(' >');
document.write(' <PARAM name="Command" value="ShortCut">');
document.write(' <PARAM name="Item1"


<A HREF="javascript:ShortCutLink.Click()">Text Link to PDF File</A>



Top ...