23 Replies Latest reply on May 8, 2017 3:22 AM by JaredHess

    Open CHM from another CHM

    jigneshs24552355

      Hi guys,

       

      I would like to open a chm file in a separate window from another chm file. Both the chm files are in the same folder.
      Suppose one of my chm named XYZ.chm and another one is ABC.chm.

       

      Now, in my ABC.chm, I want to provide a link to open the XYZ.chm in a separate window. I tried these solutions:

       

      <a href="XYZ.chm">XYZ</a>.

       

      This does not open up anything.

       

      Then, I tried to provide link to a default topic name or home page topic in the XYZ.chm like this:

       

      <a href="XYZ.chm::/Welcome_to_Adobe.htm">XYZ</a>.

       

      This opens up a that particular topic "Welcome to Adobe" and that too in the same window of the ABC.chm.

       

      Then, I tried to provide a relative path but that too did not work.

       

      Then, I tried a local path. That did work but its not useful because it can always change.

       

      So, I am looking for a solution which is independent of the local path. Maybe, through a javascript or something if it is possible.

       

      Please help. Thanks in advance.

       

      - Jignesh

        • 1. Re: Open CHM from another CHM
          Captiv8r Adobe Community Professional & MVP

          Hi there

           

          Perhaps this recent thread helps?

           

          Re: Link .CHM to .CHM using FrameMaker/Robohelp

           

          Cheers... Rick

          • 2. Re: Open CHM from another CHM
            jigneshs24552355 Level 1

            Thanks Rick. I followed the HH.exe just like how it is explained in the link but it displays an error for me:

             

            Cannot open the file.

             

            In that thread, when you are talking about a folder along with the topic name, I am not sure what you meant exactly. I have both the chms in the same folder. Is the folder name still required?

             

            If so, then which folder name? I mean do we need to provide the exact directory.

             

            Here are the screenshots:

             

            Image1.jpg

            Image2.jpg

            Here is the code:

             

            <!--Metadata type="DesignerControl" startspan

              <object classid="clsid:D5F92943-15DB-11d1-8EED-00DC929131C8" id="Shortcut1"

              border="0" style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px;

              margin-right: 0px;" align="bottom">

              <param name="_Version" value="65536"  />

              <param name="_ExtentX" value="1693"  />

              <param name="_ExtentY" value="661"  />

              <param name="_StockProps" value="13"  />

              <param name="ForeColor" value="0"  />

              <param name="BackColor" value="15790320"  />

              <param name="UseButton" value="-1"  />

              <param name="UseText" value="0"  />

              <param name="ControlLabel" value="INFORM"  />

              <param name="UseIcon" value="0"  />

              <param name="Items" value=",HH.exe,ms.its:InformSlideshow.chm::/Welcome_to_Inform_Slideshow.htm$$**$$"

               />

              <param name="Image" value=""  />

              <param name="FontInfo" value="Arial,10,0,,"  />

              <param name="_CURRENTFILEPATH" value="d:\Informa_Localization\Online Help\Slide_View.htm"

               />

              <param name="_ID" value="Shortcut1"  />

              <param name="Items" value=",HH.exe,ms.its:InformSlideshow.chm::/Welcome_to_Inform_Slideshow.htm$$**$$"

               />

              <param name="Window" value=""  />

              </object>--><object

              classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11"

              id="Shortcut1"  type="application/x-oleobject">

              <param  name="Command"  value="Shortcut" />

              <param  name="Button"  value="Text:INFORM" />

              <param  name="Font"  value="Arial,10,0,," />

              <param  name="Item1"  value=",HH.exe,ms.its:InformSlideshow.chm::/Welcome_to_Inform_Slideshow.htm" />

            </object>

            <!--Metadata type="DesignerControl" endspan-->

             

             

             

            Please help.

             

            - Jignesh

            • 3. Re: Open CHM from another CHM
              Captiv8r Adobe Community Professional & MVP

              Hmmm, okay. This is going to sound weird, but bear with me.

               

              How exactly are you testing?

              Here's why I'm asking that question. If you have a CHM file that is linked to an application, and you are opening that CHM FROM the application, the actual pathing that the CHM would know about might be different. So it's entirely possible that if you opened the CHM in that manner, the button would fail. Even though both CHM files are inside the same folder.

               

              Now if you were to just find the CHM using Windows Explorer and double-click it, the button may well perform exactly as desired.

               

              And we need also to keep in mind that in today's world, there are now two different versions of the HTML Help Viewer (used to display CHM files), With the proliferation of 64 bit operating systems, we now have a 32 bit version of the HTML Help Viewer as well as a 64 bit version of the HTML Help Viewer. So it's possible that in addition to the oddity I mentioned earlier, perhaps your application is opening the 32 bit version of the viewer and there is some issue with using the control to open the 64 bit version. I'm not saying this is what's happening here, only that it may be a factor.

               

              Cheers... Rick

              • 4. Re: Open CHM from another CHM
                jigneshs24552355 Level 1

                Thanks Rick.

                 

                Regarding testing, for now

                I have generated the two chms and kept in the same folder.

                 

                I opened the chm from where I want to open the another chm.

                 

                I clicked on the button which displayed the message "Cannot open the file".

                 

                From your explanation, it looks like this should work.

                 

                Later, the final goal is that both the chm files will reside in the same folder after the installation of the application. Somewhere in the program files. The user has to open the main chm file from the application help button and from there, we would like to provide a link to another chm which should open in a separate window.

                 

                Is something I am missing?

                • 5. Re: Open CHM from another CHM
                  Captiv8r Adobe Community Professional & MVP

                  Hello again

                   

                  Does it work if you omit the file name? In this case the dialog would look like this:

                   

                  bc3.png

                   

                  Cheers... Rick

                  • 6. Re: Open CHM from another CHM
                    jigneshs24552355 Level 1

                    No Rick. And, strange, when I click on a button, it displays two dialogs of error messages:

                     

                    • 7. Re: Open CHM from another CHM
                      Captiv8r Adobe Community Professional & MVP

                      Try removing the ms.its bit so all that is in the field is the CHM file name (including the extension of .chm)

                      • 8. Re: Open CHM from another CHM
                        jigneshs24552355 Level 1

                        Great Rick. It worked finally,

                         

                        Though I do need to try from the application which I can only do it on Monday. Thank you very much for your help.

                         

                        I will update you on Monday if it works from the application too, I think it should work.

                        • 9. Re: Open CHM from another CHM
                          jigneshs24552355 Level 1

                          Thanks Rick for your help. It seems its working fine.

                           

                          Just have a small issue with the text alignment:

                           

                          The text on the button is not aligned with the text. It is just a bit on the top. Is there a way to fix it?

                          • 10. Re: Open CHM from another CHM
                            Captiv8r Adobe Community Professional & MVP

                            Hmmm, interesting proposition.

                             

                            Okay, here's the deal. I know how to make it happen, but it will require jumping through some hoops to get there. I tried to find a nice and easy way to accomplish it, but at the moment this is the best I've come up with. Hopefully others will see this and improve upon it.

                             

                            Here is a youtube video I just created to demonstrate.

                             

                            • 11. Re: Open CHM from another CHM
                              jigneshs24552355 Level 1

                              Thanks Rick for all your help. This did help as a temporary solution.

                               

                              So, I was just thinking if there is a way to convert a button into a hyperlink. I am not able to find a way from the shortcut wizard.

                               

                              If there is a hyperlink, it would be very useful.

                               

                              1. It would solve the issue of this alignment with the text.

                               

                              2. Another thing is it would more look like a link. The button does not give a clear indication to some users that it's a link. The button looks little old format too

                              • 12. Re: Open CHM from another CHM
                                Captiv8r Adobe Community Professional & MVP

                                Hello again

                                 

                                I believe this still works.

                                 

                                Drag the shortcut button to a different location on the page. I usually place mine at the page bottom.

                                 

                                Double-click the shortcut to see the properties and choose the Hidden (for scripts) item.

                                 

                                Click OK to accept the change and dismiss the dialog.

                                 

                                sc1.png

                                 

                                At this point the button should change appearance slightly and should still be selected.

                                 

                                Click the HTML view.

                                 

                                This should reveal the code behind the button. What you are here to discover is the ID value. Likely it will be "Shortcut". (unless there is more than one on the page)

                                 

                                Now we will configure the link. Select some text that the user will click. Make it a hyperlink. But where you would normally see the path and HTML file name, type JavaScript:Shortcut.Click();

                                 

                                sc2.png

                                Cheers... Rick

                                • 13. Re: Open CHM from another CHM
                                  jigneshs24552355 Level 1

                                  Great. Thanks Rick.

                                  • 14. Re: Open CHM from another CHM
                                    jigneshs24552355 Level 1

                                    Hello Rick,

                                     

                                    Strange - It seems the shortcut button is not working when we open the help file from the application.

                                     

                                    After the installation of the application, the two help files are in the same directory (For example, somewhere in the Program files).

                                     

                                    In the application, there is a Help button which opens up the chm file.

                                     

                                    Now, from this chm, when I click on the shortcut button, it displays this message:

                                     

                                     

                                    I tried the other way.

                                     

                                    I opened the main chm from the Program files location and then tried again. It worked fine.

                                     

                                    So, will it not work from the application? This is what we need to work from the application.

                                    • 15. Re: Open CHM from another CHM
                                      Captiv8r Adobe Community Professional & MVP

                                      Ahhh yes. This is an odd phenomenon with CHM files. I'm not sure of the exact cause, but what happens is that when a CHM file has been opened from an application, the path that it understands is different than the actual path. Weird, eh?

                                       

                                      You will likely need to resort to some JavaScript that deduces the path. Hang on while I go fetch that article...

                                       

                                      First, click here and check out the article.

                                       

                                      And this link may be helpful too

                                       

                                      Good luck... Rick

                                      • 16. Re: Open CHM from another CHM
                                        jigneshs24552355 Level 1

                                        First link is not working. It displays the error 404 Not found.

                                         

                                        Second link, not able to understand much.

                                        • 17. Re: Open CHM from another CHM
                                          Captiv8r Adobe Community Professional & MVP

                                          Strange

                                           

                                          I'll just paste the link here and we can try again.

                                           

                                          Example: Link to a File Outside of Your Help System (Windows)

                                          • 18. Re: Open CHM from another CHM
                                            jigneshs24552355 Level 1

                                            It looks like it might work but I am not much familiar with the javascript.

                                             

                                            I tried to follow the instructions in the link.

                                             

                                            I created a .js file and pasted the code like this:

                                            Then, I placed the file in the root directory of the project and also added into the baggage files.

                                             

                                            Now, I went to the topic from where I want to provide a link to another chm. And, added the syntax:

                                            <p>see the <a onclick="parser('InformaSlideshow.chm')"

                                                                                             style="color: #008000;

                                                                                             cursor: hand; text-decoration: underline; ">INFORM</a>

                                                 help.</p>

                                             

                                            Now, I generated the main chm. The link looks like this:

                                            When I click the link, it displays this error:

                                             

                                             

                                            I am not sure if I am missing something.

                                            • 19. Re: Open CHM from another CHM
                                              Captiv8r Adobe Community Professional & MVP

                                              Did you ensure you referenced the javascript file in the head area of the topic?

                                               

                                              <script type="text/javascript" language="javascript" src="externallink.js" charset="utf-8"></script>

                                               

                                              Note that if the topic is in a folder, you will need to ensure the correct path is listed. Generally speaking, you can deduce the path by examining the code that links to the CSS file.

                                               

                                              Cheers.... Rick

                                              • 20. Re: Open CHM from another CHM
                                                Amebr Level 4

                                                I think you need to delete the <script> tags from your js file. You would only keep those if you were including the script code directly in your html topic.

                                                • 21. Re: Open CHM from another CHM
                                                  Captiv8r Adobe Community Professional & MVP

                                                  Ahhh that is likely true!

                                                   

                                                  Nice catch!

                                                  • 22. Re: Open CHM from another CHM
                                                    JaredHess Level 1

                                                    Hi all,

                                                     

                                                    (Jignesh and I work for the same company. So I'm responding on his thread.)

                                                     

                                                    I got this latest solution using the externallink.js working in some of our projects. I'm linking to a different chm file called MIIM.chm.

                                                     

                                                    I have a snippet with this linking code.

                                                     

                                                    <?rh-cbt_start condition="Online" ?><p class="BodyText"><a name="MIIM"></a>You

                                                    can access the MIIM.chm help file, from this link: <?rh-cbt_start condition="Online" ?><a

                                                         href="#MIIM'" onclick="parser('MIIM.chm')">MIIM Help</a><?rh-cbt_end ?>.

                                                    When the <span class="bold">File Download - Security Warning</span> dialog

                                                    box appears, click <span class="bold">Open</span> to open the help in

                                                    a separate help viewer.</p><?rh-cbt_end

                                                     

                                                     

                                                    Notice the "a name" and the "a href". I added the link to the named anchor "#MIIM" so that it wouldn't jump to the top of the topic when users click on the link.

                                                     

                                                    The snippet works great, but only in projects that don't have subfolders.

                                                     

                                                    If I use the snippet in projects where the .htm file is in sub folders, the link evaluates to something like:

                                                     

                                                          <a href="../.#MIIM" onclick="parser('MIIM.chm')">MIIM Help</a>

                                                     

                                                    Since it's looking two directories higher, this breaks the link obviously, and returns this error:

                                                    Any ideas on how to make the link always link to the current page at that #MIIM named anchor?

                                                    • 23. Re: Open CHM from another CHM
                                                      JaredHess Level 1

                                                      Nevermind, I found the solution. Don't add in the href. I was adding it in because our style sheet wasn't styling the a link without it. I modified a styles sheet and then removed the href from the above .html code of href="#MIIM'", and now it works in subfolders.