none
Word 2013 - Hidden text is messing up! RRS feed

  • Question

  • Hi Team,

    We are transforming xml to xhtml and opening it in Word. When transforming the html we also make sure the html is styled properly as per Word. In our content, we have hidden texts as well.

    If the html is opened in Word 2013 the hidden text is getting messed up and not getting hide properly. - This is happening ONLY with Word 2013. No issues at Word 2007 and 2010.

    We also observed this behavior happens only with the below case.

    Content - Styled as hidden text. => Working fine

    • Bullet point 1 - Styled as hidden text => Not working - Note the first bullet point in the list is not getting hide. (Even the entire OL is style as hidden)
    • Bullet Point 2 - Styled as hidden text. => Working fine.

    Please help! Thanks in Advance.

    Please find the below sample html. Open it in Word 2013 and toggle "Display Hidden text" option on/off to see the issue in action.

    Note: Due to character limit, i am not able to provide entire html. The below HTML is only the BODY tag. We do have all the styles defined at Head tags.

    Thanks,

    Kannan

    <body lang=EN-US style='tab-interval:.5in'>
    
    <div class=WordSection1>
    <div>
    
    <p class=APPracticalBulleted style='margin-left:.5in;mso-list:l5 level1 lfo8;
    display:none'><![if !supportLists]><u style='text-underline:#000000'><span
    style='font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
    Symbol;color:windowtext;text-underline:#000000;text-decoration:none;text-underline:
    none'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    </span></span></span></u><![endif]><u style='text-underline:#000000'>Sample content.<o:p></o:p></u></p>
    
    <p class=APPracticalBulleted style='margin-left:.75in;mso-list:l5 level2 lfo8;
    tab-stops:list .5in'><![if !supportLists]><u style='text-underline:#000000'><span
    style='font-family:"Times New Roman","serif";mso-fareast-font-family:"Times New Roman";
    text-underline:#000000;text-decoration:none;text-underline:none'><span
    style='mso-list:Ignore'>○<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    </span></span></span></u><![endif]><u style='text-underline:#000000'><span
    style='mso-hide:none'>This content is styled as hidden. But not getting hide.</span><o:p></o:p></u></p>
    
    <p class=APPracticalBulleted style='margin-left:.75in;mso-list:l5 level2 lfo8;
    display:none;tab-stops:list .5in'><![if !supportLists]><u style='text-underline:
    #000000'><span style='font-family:"Times New Roman","serif";mso-fareast-font-family:
    "Times New Roman";text-underline:#000000;text-decoration:none;text-underline:
    none'><span style='mso-list:Ignore'>○</span></span></u><![endif]><u
    style='text-underline:#000000'>This text is normal text, which is getting messed with hidden text.<o:p></o:p></u></p>
    
    <p class=APPracticalBulleted style='margin-left:.75in;mso-list:l5 level2 lfo8;
    display:none;tab-stops:list .5in'><![if !supportLists]><u style='text-underline:
    #000000'><span style='font-family:"Times New Roman","serif";mso-fareast-font-family:
    "Times New Roman";text-underline:#000000;text-decoration:none;text-underline:
    none'><span style='mso-list:Ignore'>○</span></span></u><![endif]><u
    style='text-underline:#000000'>Sample Content;<o:p></o:p></u></p>
    
    <p class=APPracticalBulleted style='margin-left:.75in;mso-list:l5 level2 lfo8;
    display:none;tab-stops:list .5in'><![if !supportLists]><u style='text-underline:
    #000000'><span style='font-family:"Times New Roman","serif";mso-fareast-font-family:
    "Times New Roman";text-underline:#000000;text-decoration:none;text-underline:
    none'><span style='mso-list:Ignore'>○</span></span></u><![endif]><u
    style='text-underline:#000000'>Sample Content<o:p></o:p></u></p>
    
    <p class=APPracticalBulleted style='margin-left:.75in;mso-list:l5 level2 lfo8;
    display:none;tab-stops:list .5in'><![if !supportLists]><u style='text-underline:
    #000000'><span style='font-family:"Times New Roman","serif";mso-fareast-font-family:
    "Times New Roman";text-underline:#000000;text-decoration:none;text-underline:
    none'><span style='mso-list:Ignore'>○</span></span></u><![endif]><u
    style='text-underline:#000000'>Sample Content.<o:p></o:p></u></p>
    
    </div>
    
    <div>
    
    <p class=APPracticalBulleted style='margin-left:.5in;mso-list:l5 level1 lfo8;
    display:none'><![if !supportLists]><u style='text-underline:#000000'><span
    style='font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
    Symbol;color:windowtext;text-underline:#000000;text-decoration:none;text-underline:
    none'><span style='mso-list:Ignore'>·</span></span></u><![endif]><u
    style='text-underline:#000000'>Sample Content </u><!--[if supportFields]><span
    class=PPCRefAAALGebeb612531994336b2a27df55f861436ebeb612531994336b2a27df55f861436><u
    style='text-underline:#000000'><span style='text-underline:#000000;text-decoration:
    none;text-underline:none'><span style='mso-element:field-begin'></span>MACROBUTTON
    PPC_LINKMANAGER ALG-CX-4.2.2</span></u></span><![endif]--><!--[if supportFields]><span
    class=PPCRefAAALGebeb612531994336b2a27df55f861436ebeb612531994336b2a27df55f861436><u
    style='text-underline:#000000'><span style='text-underline:#000000;text-decoration:
    none;text-underline:none'><span style='mso-element:field-end'></span></span></u></span><![endif]--><u
    style='text-underline:#000000'> .)<o:p></o:p></u></p>
    
    </div>
    
    <div>
    
    <p class=APPracticalBulleted style='margin-left:.5in;mso-list:l5 level1 lfo8;
    display:none'><![if !supportLists]><u style='text-underline:#000000'><span
    style='font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
    Symbol;color:windowtext;text-underline:#000000;text-decoration:none;text-underline:
    none'><span style='mso-list:Ignore'>·</span></span></u><![endif]><u
    style='text-underline:#000000'>Sample Content<o:p></o:p></u></p>
    
    </div>
    
    </div>
    
    </body>


    Thanks, Kannan.M

    Friday, September 4, 2015 3:09 PM

Answers

  • Hello Kannan –

    I was researching on the HTML and observed that flipping below tag from ‘all’ to ‘none’ adds a ‘vanish’ element for this text.  We are pretty sure that you have to research on adding correct HTML elements which should resolve the issue.

    Displaying HTML file and conversion when file is opened in word is not in open specification support (my team). Hence we won’t be able to help much further, however, if you would like to pursue further then you can open a new case with word support.

    <body lang=EN-US style='tab-interval:.5in'>

                <div>

                    <proceduresection id="b20b2e5af11b440694a328b6abc50098">

                        <step changed="02/28/2014" id="64ac0a4c0db943dda3854d9eaeb0e2bd" required="true">

                            <practicalconsideration id="b92d3245ef78440c8083b5da970a836b" type="">

                                <div>

                                    <p style="margin->Sample content:</p>

                                    <ul>

                                        <li style="margin->This content is styled as hidden. But not getting hide</li>

                                        <li style="margin->This text is normal text, which is getting hidden</li>

                                        <li style="margin->Sample content</li>

                                        <li style="margin->Sample content</li>

                                        <li style="margin->Sample content</li>

                                    </ul>

                                </div>

                            </practicalconsideration>

                        </step>

                    </proceduresection>

                </div>

            </body>

    Best Regards,

    Tuesday, September 8, 2015 6:34 PM

All replies

  • Hello Kannan,
                       Thank you for your inquiry about Microsoft Office Document Protocols. One of the Open specifications team member will contact you shortly.

    Regards,
    Sreekanth Nadendla
    Microsoft Windows Open Specifications

    Friday, September 4, 2015 5:57 PM
    Moderator
  • Hello Kannan -

    I'm researching on this and will get back.

    Regards


    Tarun Chopra | Escalation Engineer | Open Specifications Support Team

    Friday, September 4, 2015 6:15 PM
  • Hello Kannan

    Per IS/IEC 29500; Vanish (Hidden Text) element is used to hide the content - https://msdn.microsoft.com/en-us/library/documentformat.openxml.wordprocessing.vanish(v=office.14).aspx . By saving your file in .docx format ; we observed that ‘vanish’ element is not specified for this text ‘This content is styled as hidden. But not getting hide’; which is the primary reason word is not hiding it. Please have a look at the way you are converting this XML to XHTML to resolve this issue. Furthermore, your sample is producing same result in  word 2010 and 2013 and hence we don’t think it’s word 2013 issue per say.

    After adding vanish element to your non-hidden paragraph, I’m able to make it work –

            <w:p w:rsidR="00000000" w:rsidRDefault="00075CBF">

                <w:pPr>

                    <w:pStyle w:val="appracticalbulleted"/>

                    <w:tabs>

                        <w:tab w:val="num" w:pos="720"/>

                    </w:tabs>

                    <w:ind w:left="1080"/>

                    <w:divId w:val="1071653636"/>

                  <w:rPr>

                        <w:vanish/>

                    </w:rPr>

                </w:pPr>

                <w:r>

                    <w:rPr>

                        <w:rFonts w:eastAsia="Times New Roman"/>

                        <w:u w:color="000000"/>

                       <w:vanish/>

                    </w:rPr>

                    <w:t>?</w:t>

                </w:r>

                <w:r>

                    <w:rPr>

                        <w:rFonts w:eastAsia="Times New Roman"/>

                        <w:sz w:val="14"/>

                        <w:szCs w:val="14"/>

                        <w:u w:color="000000"/>

                       <w:vanish/>

                    </w:rPr>

                    <w:t xml:space="preserve">                 </w:t>

                </w:r>

                <w:r>

                    <w:rPr>

                        <w:u w:val="single" w:color="000000"/>

                       <w:vanish/>

                    </w:rPr>

                    <w:t>This content is styled as hidden. But not getting hide</w:t>

                </w:r>

                <w:r>

                    <w:rPr>

                        <w:u w:val="single" w:color="000000"/>

                       <w:vanish/>

                    </w:rPr>

                    <w:t>.</w:t>

                </w:r>

            </w:p>

    If you still have queries, please send us your sample source XML to our attention at  - dochelp at microsoft dot com

    Regards


    Tarun Chopra | Escalation Engineer | Open Specifications Support Team

    Friday, September 4, 2015 8:47 PM
  • Thanks for your quick response Tarun Chopra. Yes, we observed that the "vanish" element is missing while we open our HTML in Word. But while opening our own html in word, those "vanish" elements are getting added by Word application. Have sent an email to dochelp at Microsoft dot com for the html file where you can reproduce the issue. Please let me know if you haven't receive the file. Also shared through OneDrive. Please find the file at the below link as well.

    https://onedrive.live.com/redir?resid=B45F0499C79300C3!793&authkey=!APgVA0PAAOnplWg&ithint=file%2chtml

    Here is the scenario:

    • We generate HTML content from XML.
    • Saving the html content as .html in temp directory.
    • Opening it in Word using "documentObj = m_oWord.Documents.Add(ref arg1, ref arg2, ref arg3, ref arg4);" - Where arg1 = temp .html path.
    • Saving it in the local drive as docx.

    Which you can reproduce by,

    • Saving the below html content at your local as .html
    • "Open with" Word 2013 and lower versions (Either Word 2010 / 2007)
    • Observe the result.

    And it is happening ONLY for the first bullet item, when the whole OL is styled as hidden. Please help!

    Thanks in Advance,

    Kannan.

    ____________________________________________________


    Monday, September 7, 2015 1:23 PM
  • Hello Kannan -

    Thanks for additional information. I'll review the information and update. We have also received the files thro' dochelp. Thanks a lot.

    Regards.


    Tarun Chopra | Escalation Engineer | Open Specifications Support Team

    Monday, September 7, 2015 4:18 PM
  • Hello Kannan –

    I was researching on the HTML and observed that flipping below tag from ‘all’ to ‘none’ adds a ‘vanish’ element for this text.  We are pretty sure that you have to research on adding correct HTML elements which should resolve the issue.

    Displaying HTML file and conversion when file is opened in word is not in open specification support (my team). Hence we won’t be able to help much further, however, if you would like to pursue further then you can open a new case with word support.

    <body lang=EN-US style='tab-interval:.5in'>

                <div>

                    <proceduresection id="b20b2e5af11b440694a328b6abc50098">

                        <step changed="02/28/2014" id="64ac0a4c0db943dda3854d9eaeb0e2bd" required="true">

                            <practicalconsideration id="b92d3245ef78440c8083b5da970a836b" type="">

                                <div>

                                    <p style="margin->Sample content:</p>

                                    <ul>

                                        <li style="margin->This content is styled as hidden. But not getting hide</li>

                                        <li style="margin->This text is normal text, which is getting hidden</li>

                                        <li style="margin->Sample content</li>

                                        <li style="margin->Sample content</li>

                                        <li style="margin->Sample content</li>

                                    </ul>

                                </div>

                            </practicalconsideration>

                        </step>

                    </proceduresection>

                </div>

            </body>

    Best Regards,

    Tuesday, September 8, 2015 6:34 PM