![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
![]() ![]() |
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:
its:C:\WINDOWS\Help\mspaint.chm::/paint_airbrush.htm
Copy the path above and set your %WINDIR% to test it.
Test
This will fail under SP2 * Now Fail *
<a href="JavaScript:window.showHelp('ms-its:joy.chm::/cpl_joy_overview.htm')">Help</a>
Full path to CHM - ** OK ** This will fail under
SP2 * Now Fail *
ms-its:http://www.help-info.de/files_download/CHM-example.chm::/index.htm
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:http://www.help-info.de/files_download/CHM-example.chm::/Garden/flowers.htm">Link
to a topic in a .chm</a>
Link
to a topic in a .chm
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:
www.logicsmith.com/files/chmincab.zip
1) Use following syntax in your HHC file:
///
<LI><OBJECT type="text/sitemap">
<param name="Name" value="Link PDF from CHM">
<param name="Local"
value="http://www.help-info.de/files_download/example.pdf">
<param name="WindowName" value="main">
</OBJECT>
\\\
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,">
</object>
3)
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
http://www.easyhtmlhelp.com
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 http://ehtmlhelp.listbot.com/
--------------------------------------------------------------------
From: Jeff Hall HTMLHelp MVP http://www.easyhtmlhelp.com
Subject: Linking to an external PDF file from a CHM
Problem:
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.
Cause:
The CHM file assumes the current DEFAULT directory for shortcuts.
This may be different to the location of the CHM file folder.
Solution:
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.
-->
<HTML>
<TITLE>EasyHTMLHelp.com - robust method of calling an external PDF from
a
CHM</TITLE>
<HEAD>
</HEAD>
<BODY>
<SCRIPT>
//Create the chmfile object for this HTML page
var chmfile = new Object();
chmfile.fullname = "";
chmfile.name = "";
chmfile.path = "";
chmfile.page = "";
getchmfile();
//Get the path and name of the CHM file and assign object values
function getchmfile(){
var ra, sl, a, X, Y, Z;
ra = /:/;
a = location.href.search(ra);
sl = "::";
Y = location.href.lastIndexOf(sl);
if (a == 4) { // file: or http:
Y = location.href.lastIndexOf("/");
chmfile.page = 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));
chmfile.name = unescape(chmfile.fullname.substring(Z+1));
chmfile.page = unescape(location.href.substring(Y+3));
}
/*
alert(location.href+"\n\n"+"fullname="+chmfile.fullname+"\n"+"path="+chmfile.pat
h+"\n"+"name="+chmfile.name+"\n"+"page="+chmfile.page);
*/
}
//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"
value=",'+chmfile.path+relativepath+',">');
document.write('</OBJECT>');
//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"
value=",'+chmfile.path+relativepath2+',">');
document.write('</OBJECT>');
</SCRIPT>
<BR><BR>
<A HREF="javascript:ShortCutLink.Click()">Text Link to PDF File</A>
</BODY>
</HTML>
![]() |