Menu

#36 MS Word 'review comments' result in adddRule error in CHM

v1.7
open
None
5
2016-06-17
2016-05-22
No

If review comments are left in the word document, the following error is generated when opening the resulting CHM file:
Line: 73
Char: 2
Error: "Unable to get property 'addRule' of undefined or null reference"
Code: 0

DOC/WHC/CHM attached.

1 Attachments

Related

Bugs: #36

Discussion

  • Michael Litwak

    Michael Litwak - 2016-06-17

    Apparently, chmProcessor calls upon Microsoft Word to convert the Word document sections into .HTM files using Word's HTML(Filtered) converter. When newer versions of Word do this, they add some extra JavaScript to each .HTM file. Specifically, the following lines seem to trigger the "Unable to get property 'addRule'" error:

    document.styleSheets.dynCom.addRule(".msocomanchor","background: infobackground");
    document.styleSheets.dynCom.addRule(".msocomoff","display: none");
    document.styleSheets.dynCom.addRule(".msocomtxt","visibility: hidden");
    document.styleSheets.dynCom.addRule(".msocomtxt","position: absolute");
    document.styleSheets.dynCom.addRule(".msocomtxt","top: -1000");
    document.styleSheets.dynCom.addRule(".msocomtxt","left: -1000");
    document.styleSheets.dynCom.addRule(".msocomtxt","width: 33%");
    document.styleSheets.dynCom.addRule(".msocomtxt","background: infobackground");
    document.styleSheets.dynCom.addRule(".msocomtxt","color: infotext");
    document.styleSheets.dynCom.addRule(".msocomtxt","border-top: 1pt solid threedlightshadow");
    document.styleSheets.dynCom.addRule(".msocomtxt","border-right: 2pt solid threedshadow");
    document.styleSheets.dynCom.addRule(".msocomtxt","border-bottom: 2pt solid threedshadow");
    document.styleSheets.dynCom.addRule(".msocomtxt","border-left: 1pt solid threedlightshadow");
    document.styleSheets.dynCom.addRule(".msocomtxt","padding: 3pt 3pt 3pt 3pt");
    document.styleSheets.dynCom.addRule(".msocomtxt","z-index: 100");

    By generating an HTML Help project (rather than a CHM), you can delete these lines from each HTM file before manually compiling the project using the HTML Help Workshop. The resulting CHM will no longer issue the error. Perhaps running chmProcessor on a PC with an older version of Word would be a better work-around. chmProcessor source could be modified to remove the above lines from the HTM files prior to compiling them into a CHM.

     
    • Patrice Carbonneau

      Michael,
      Thanks for taking the time looking at this.
      The obvious work around is to prcess a copy of the Word document where review comments have been removed.
      I was not looking for a different work around but simply document the issue.
      Once again, great application.

       
      • Michael Litwak

        Michael Litwak - 2016-07-11

        Patrice,

        Thanks for letting me know that the addRule statements come from Word
        documents with review comments. I hadn't realized that.

        By the way, I am not a chmProcessor developer - just an end-user like
        yourself.

        Regards,

        • Michael

        From: Patrice Carbonneau [mailto:patcarbo@users.sf.net]
        Sent: Sunday, July 10, 2016 4:44 AM
        To: [chmprocessor:bugs] 36@bugs.chmprocessor.p.re.sf.net
        Subject: [chmprocessor:bugs] Re: #36 MS Word 'review comments' result in
        adddRule error in CHM

        Michael,
        Thanks for taking the time looking at this.
        The obvious work around is to prcess a copy of the Word document where
        review comments have been removed.
        I was not looking for a different work around but simply document the issue.
        Once again, great application.


        [bugs:#36] https://sourceforge.net/p/chmprocessor/bugs/36/ MS Word
        'review comments' result in adddRule error in CHM

        Status: open
        Group: v1.7
        Created: Sun May 22, 2016 11:20 AM UTC by Patrice Carbonneau
        Last Updated: Fri Jun 17, 2016 01:17 AM UTC
        Owner: Antonio Fco. Bennasar Obrador
        Attachments:

        If review comments are left in the word document, the following error is
        generated when opening the resulting CHM file:
        Line: 73
        Char: 2
        Error: "Unable to get property 'addRule' of undefined or null reference"
        Code: 0

        DOC/WHC/CHM attached.


        Sent from sourceforge.net because you indicated interest in
        https://sourceforge.net/p/chmprocessor/bugs/36/

        To unsubscribe from further messages, please visit
        https://sourceforge.net/auth/subscriptions/

         

        Related

        Bugs: #36


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.