Link to a topic in another file

HM5 served us well, now its time has come and it has been replaced... If you have HM5 questions, please post them here.

Moderators: Alexander Halser, Tim Green

Post Reply
Alex Gurevich
Posts: 18
Joined: Wed Feb 22, 2012 6:50 am

Link to a topic in another file

Unread post by Alex Gurevich »

Dear colleagues!
We use Help and Manual for creating help files in CHM format.
How could we create a link to a topic located in another file?

For HTML help file I have found the following expression:

Code: Select all

index.html?topicname.htm#anchorname
We need a similar expression for CHM help file.

For definiteness, the file that we would like to link is called index.chm, the topic - topicname, the anchor - anchorname.
But it will be better to create the link without anchors, only to the topic in another file located in the same folder.
Thank you.
User avatar
Tim Green
Site Admin
Posts: 23155
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Link to a topic in another file

Unread post by Tim Green »

Hi Alex,
Alex Gurevich wrote:For HTML help file I have found the following expression:
That is for WebHelp (browser-based HTML). "HTML Help" is Microsoft's official and unfortunately confusing name for the CHM format. :)

When you link to a topic in another CHM file, the other file MUST be in the same folder as the CHM file containing the link. There are two ways to link to a topic in another CHM. Which one you use depends on whether you want the topic to be displayed inside the current help viewer or in a separate window in a new help viewer.

Display in the current help viewer

For this to work, the Help & Manual project with which you create the CHM file must have exactly the same name as the CHM file -- if you link via the project. For example, if the CHM file is called index.chm, then the project must be called index.hmxz or index.hmxp. Also, no spaces are allowed in the project or CHM file name. If the names are not the same, the link cannot know what the name of the CHM file is going to be. Alternatively, you can link directly to the CHM file, but you must have the CHM file available to be able to do that.
  1. Open the link tool to create a normal topic link and select the Help & Manual project of the other CHM file in the Help FIle: field at the bottom. Alternatively, select the CHM file in that field. The topic IDs will then be displayed.
  2. Select the correct target ID you want to link to and create the link.
  3. Make sure that both CHM files are in the same folder when the user views them.
Display in a new help viewer:

Here too, no spaces or other special characters are permitted in the CHM file names. Also, the CHM file containing the link and the CHM file you are linking to must both be in the same folder.
  1. Open the Link tool and instead of creating a topic link, select the File Link option.
  2. In the File name: field enter the program name of the help viewer:
    hh.exe
  3. In the Execution parameters: field enter the name of the CHM file and topic, using the following exact syntax:
    ms-its:helpfile.chm::/topicname.htm#anchor
    helpfile.chm is the name of the target CHM file. topicname.htm is the Topic ID of the target topic in all lower case characters plus the extension ".htm". anchor is an optional anchor ID you want to jump to on the page, also in all lower case.
  4. Make sure that both CHM files are in the same folder when the user views them.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Alex Gurevich
Posts: 18
Joined: Wed Feb 22, 2012 6:50 am

Re: Link to a topic in another file

Unread post by Alex Gurevich »

Dear Tim,

Thank you very much. It's great!
The second way is the most suitable for us.

With my best wishes,
Alex
Last edited by Alex Gurevich on Wed May 27, 2015 2:02 pm, edited 1 time in total.
Alex Gurevich
Posts: 18
Joined: Wed Feb 22, 2012 6:50 am

Re: Link to a topic in another file

Unread post by Alex Gurevich »

One more question on this subject.
Is it possible to add any parameters in these expressions:

Code: Select all

hh.exe
or

Code: Select all

ms-its:helpfile.chm::/topicname.htm#anchor
or anyhow else to get the CHM file with all topics opening (visible) in the viewer (Open All)?
User avatar
Tim Green
Site Admin
Posts: 23155
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Link to a topic in another file

Unread post by Tim Green »

The parameters are already the "Execution parameters:" part. There is no Open All command, and you really shouldn't need one unless you have only one chapter with all your other chapters hidden inside it. If you have done that it is an error and you need to change the structure of your project to have multiple chapters with your main themes on the top level.

If you just enter

Code: Select all

ms-its:helpfile.chm
It will simply open the other CHM file at the default topic.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Alex Gurevich
Posts: 18
Joined: Wed Feb 22, 2012 6:50 am

Re: Link to a topic in another file

Unread post by Alex Gurevich »

Thank you very much!
VaLene Hulme
Posts: 7
Joined: Thu Apr 18, 2013 9:14 pm

Re: Link to a topic in another file

Unread post by VaLene Hulme »

I am having trouble linking to a help topic in another .chm. If I follow the first set of instructions (using the same help window), it works fine. However, I would prefer the link to open the .chm in another help window. When I follow those instructions, open the .chm help file, and click the link, I get this error:

"The program or feature "\??\C:\Users\valeneh\Desktop\Test Builds\hh.exe" cannot start or run due to incompatibity with 64-bit versions of Windows. Please contact the software vendor to ask if a 64-bit Windows compatible version is available." (Yes, the error spells incompatibility wrong.)

Any ideas?

Both .chm files are in the same folder. I've attached an image of the hyperlink setup screen.
You do not have the required permissions to view the files attached to this post.
User avatar
Tim Green
Site Admin
Posts: 23155
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Link to a topic in another file

Unread post by Tim Green »

Hi VaLene,
VaLene Hulme wrote:I am having trouble linking to a help topic in another .chm. If I follow the first set of instructions (using the same help window), it works fine. However, I would prefer the link to open the .chm in another help window. When I follow those instructions, open the .chm help file, and click the link, I get this error:
I can't reproduce this on 64-bit Windows. Either you are running an incompatible version of the HTML Help system (maybe an older or even a newer installer than the correct one) or something else is going on.

You can get the correct version of HTML Help Workshop with the compiler here:

https://www.helpandmanual.com/download/htmlhelp.exe

Before installing it, uninstall HTML Help Workshop in the Windows Control Panel and restart Windows. Note that when you install you will receive a misleading error message saying that you already have a "newer version of HTML Help". That can be ignored, it's an error in the installer. Actually, on all current versions of Windows this message means that the compiler has been installed correctly.

Things to check if that doesn't help:
  1. How are you starting the CHM file when you are getting the error? The options would be a) Automatically after publishing with HM, b) From your application and c) By double-clicking it in Windows File Explorer.
  2. If you are starting from your application, is it a 64-bit or a 32-bit application?
  3. Are you compiling the CHM on 32-bit or 64-bit Windows?
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
prateekch
Posts: 4
Joined: Wed Oct 30, 2019 7:44 am

Re: Link to a topic in another file

Unread post by prateekch »

Dear Tim
I have tried both approaches. I am able to do it the first one i.e. Display in the current help viewer.
Second approach i.e. Display in a new help viewer, is working fine when I click the Test button. But when I published it, then the generated chm file is not able to open the another/target chm file in the new viewer. I have followed all the steps as mentioned by you.
Do you have any idea why I am able to see the target chm in new viewer while clicking the Test Button but not when published.

I am using Help and Manual 8.0

Regards
Prateek
User avatar
Tim Green
Site Admin
Posts: 23155
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Link to a topic in another file

Unread post by Tim Green »

prateekch wrote: Mon Jun 22, 2020 11:55 am I am using Help and Manual 8.0
This is the Help+Manual 5 section of the forum... 8)
Do you have any idea why I am able to see the target chm in new viewer while clicking the Test Button but not when published.
The Test button does not really say anything about how it will work when it is actually deployed. For these links to work both CHMs must be in the same folder on a local hard drive. This will not work on external or network drives or on files that are located anywhere but in the same folder as the CHM containing the link. The names of all CHM files must not contain any spaces, non-alphanumeric characters or special characters of any kind.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Post Reply