#### 18.6.3 Linking to external files from compiled HTML Help

Compiled HTML Help allows calls to a non-CHM file only if the path to that file is absolute. If your Help system is always installed to the same drive and path, you can hardcode the path in the link, but that is not usually the case. Instead, you can use JavaScript to determine the location of the calling CHM file at run time and prefix that path (possibly modified with additional elements) to the target file name in the link. In effect, this method provides a relative path. See the following MSDN article for details:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/htmlhelp/html/vsconocxscriptslinkchm.asp

The MSDN article says the external file must be in the same directory as the calling CHM file, but that is not true. You just have to know where the external file is relative to the calling CHM file, and use the external file name with that relative path; the JavaScript adds the first part of the path. You can use a DITA2Go macro to provide the JavaScript; see §37. Working with macros.

Linking to Web sites

For external links on the Web, you can use the full Web link. However, you might encounter security issues in Internet Explorer, so test thoroughly on machines with the latest security patches. You might have to tweak Windows Registry settings, which you cannot do from within HTML Help. For example, on Windows 2000:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp\1.x\HHRestrictions]
"MaxAllowedZone"=dword:00000004
"EnableFrameNavigationInSafeMode"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp\1.x\ItssRestrictions]
"MaxAllowedZone"=dword:00000004

Previous Topic: 18.6.2 Specifying href link syntax for HTML Help

Next Topic: 18.7 Creating related-topic links for HTML Help

Parent Topic: 18.6 Creating links and hypertext jumps in HTML Help

Sibling Topics:

18.6.1 Creating hypertext jumps to other CHM files

18.6.2 Specifying href link syntax for HTML Help

Table of Contents • Index