none
How to get bulleted/numbered list in "UL/OL" HTML tags RRS feed

  • Question

  • Hello,

    I noticed that lists get converted to many span tags (see below snippet) when I save them with html file type in Word 2007 application. Is there any way to get them in UL/OL tags instead? I've been looking at ListFormat, ListStyle, etc for the past few days, and couldn't find any properties or methods that could change the behavior.. Any help would be greatly appreciated.

    <p class=MsoListParagraphCxSpLast style='margin-left:.25in;text-indent:-.25in'><span
    
    style='font-family:Symbol'>·<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    
    </span></span>My Bullet List 2</p>
    
    
    
    <p class=MsoNormal>&nbsp;</p>
    
    
    
    <p class=MsoListParagraphCxSpFirst style='text-indent:-.25in'>1.<span
    
    style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>My
    
    Number List 1</p>

     

     


    • Edited by sikim Thursday, September 15, 2011 7:30 PM
    • Moved by Cindy Meister MVPModerator Friday, September 16, 2011 6:24 AM Word-specific issue (From:Visual Studio Tools for Office)
    Thursday, September 15, 2011 7:26 PM

Answers

  • Hi Stephanie

    You'll find the dialog box at "Office button"/Word Options/Advanced/General/Web options. All the options are in there. And Save As "Web Page, Filtered".


    Cindy Meister, VSTO/Word MVP
    Saturday, September 17, 2011 7:33 AM
    Moderator

All replies

  • Hi sikim

    Word's conversion to HTML file format is explicitly designed to make the file "round-trippable". The idea is to allow the document to be displayed in a browser as well as being editable in Word - without losing any of the Word content.

    Basically, that means there's no way to turn a Word document into a true, optimal HTML file by using Save As.

    You don't mention which version of Word is involved, here, but there are some "Web option" available in the "Options" that you can try. Disabling CSS or saving for an older browser version, for example, might have some affect...


    Cindy Meister, VSTO/Word MVP
    Friday, September 16, 2011 7:21 AM
    Moderator
  • Hi Cindy,

    Thanks for the detailed explanation. It makes sense.

    What are the web options or CSS that I can try? I use Word 2007 (Interop.Word 12.0). Just to briefly explain, my add-in application 1) copies the selected range of the user document to a new document, 2) and modifies the data a bit, then saves to database in HTML format.

    Regards,
    Stephanie

    Friday, September 16, 2011 1:44 PM
  • Hi Stephanie

    You'll find the dialog box at "Office button"/Word Options/Advanced/General/Web options. All the options are in there. And Save As "Web Page, Filtered".


    Cindy Meister, VSTO/Word MVP
    Saturday, September 17, 2011 7:33 AM
    Moderator