none
Problem opening chm-files from Word, Excel and PowerPoint 2013 RRS feed

  • Question

  • Hi,

    I have a chm-file located on a file server. I have used the UrlAllowList to make it possible to open chm-files from the folder . It works fine when I open the file from Explorer by double clicking it. It does not however work when I open it from within Word, Excel or PowerPoint 2013 using the code below (it works fine in Office 2010, though).

    Declare Function HtmlHelp Lib "HHCtrl.ocx" Alias "HtmlHelpA" _
        (ByVal hwndCaller As Long, _
        ByVal pszFile As String, _
        ByVal uCommand As Long, _
        dwData As Any) As Long
      
        Const HH_DISPLAY_TOPIC = &H0
        Const HH_HELP_CONTEXT = &HF

    Call HtmlHelp(0, strMyHelpFilePath, HH_DISPLAY_TOPIC, ByVal strStartPage)

    'strMyHelpFilePath is a string value that contains the path to the chm-file.

    'strStartPage is a string value that contains "start.htm" witch is the default topic for the chm-file.

    When I open the chm-file from Explorer, or store the chm-file on my local hard drive and use the macro to open it, I get this string when I right click the start.htm-page and choose Properties:

    mk:@MSITStore:K:\Tjörn\Mallar\uniForm\Under%20utveckling\uniForm%202013\Gemensamma%20mallar\Source\Help.chm::/start.htm

    When I try to open the chm-file located on the server via the macro I get a lot of extra informatino in front of the mk:@-part (don't have access to the extra text right now).

    So, my question is: How can I get the chm-file to open correctly from Word while stored on a file sever?

    Regards, Åsa

    Wednesday, March 19, 2014 11:58 AM

All replies

  • Hello Asa,

    Do you have x64 or x86 based Office 2013 installed on the machine?

    Also, as a workaround, you can use the Help method of the Application class.

    Wednesday, March 19, 2014 2:56 PM
  • Hi,

    I have Windows 7 64-bit and Office 2013 32-bit.

    Don't think Application.Help can be used to open custom chm-files. At least I havn't been able to make it work. 

    Wednesday, March 19, 2014 3:20 PM
  • Asa,

    Did you try to use the activex component outside of Office applications? Does it work as expected?

    It looks like the issue is not related to Office at all. Instead, it depends on the HHCtrl.ocx component.

    Wednesday, March 19, 2014 4:13 PM
  • But it works fine when the chm-file is stored locally, only not when it is stored on the server. It also works fine on Office 2010 with the exact same version of HHCtrl.ocx.
    Wednesday, March 19, 2014 4:25 PM
  • Hi,

    I failed to reproduce the issue in my test enviroment. Below is the steps:

    1. create a website and upload the CHM file to the site

    2. create a document and put the code below to a module

    Declare Function HtmlHelp Lib "HHCtrl.ocx" Alias "HtmlHelpA" _
         (ByVal hwndCaller As Long, _
         ByVal pszFile As String, _
         ByVal uCommand As Long, _
         dwData As Any) As Long
        
         Const HH_DISPLAY_TOPIC = &H0
         Const HH_HELP_CONTEXT = &HF
    
    Sub OpenCHM()
    Dim a As Object
    Call HtmlHelp(0, "http://localhost/MyWebApplication1/appverif.chm", HH_DISPLAY_TOPIC, a)
    End Sub
    

    The code works well for me. My Word version is:

    I suggest you update the Office to the latest version to see whether this issue is fixed.

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thursday, March 20, 2014 10:12 AM
    Moderator