We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Word ordered lists to html


I trying to convert a *docx file into html.
In numeric list, i have a strange results.
in docx:

Ordered list
1. One. Bond item with text
2. additionalList
2.1. a
2.2. b
2.3. c
3. Two. Bond item with no bond text
4. Three.

Other ordered list
1.1. OneOne
1.2. OneTwo
1.3. OneThree

in html:
Ordered list

1. One. Bond item with text
2. additionalList
3.Two. Bond item with no bond text

Other ordered list


Can i get ordered list with right numbers, if i use a
ExportListLabels = ExportListLabels.ByHtmlTags,
Option ?
As i mean, decimal numbers can be added in html with this styles:
OL { counter-reset: item }
LI { display: block }
LI:before { content: counters(item, ".") " "; counter-increment: item }

- your solution supports this feature?

Hi Alexander,

Thanks for your inquiry. In your case, I suggest you please use ExportListLabels as AsInlineText or Auto to get the required output. Using ExportListLabels.ByHtmlTags output all list labels as HTML native elements. Please check the following code example for your kind reference. Hope this helps you.

If you face any issue, please share your input document here for testing. I will investigate the issue and provide you more information.

Document doc = new Document(“in.docx”);

HtmlSaveOptions saveOptions = new HtmlSaveOptions(SaveFormat.Html);<o:p></o:p>

// ExportListLabels.Auto is the default value of this option.

saveOptions.ExportListLabels = ExportListLabels.Auto;<o:p></o:p>

doc.Save(@“test_auto.html”, saveOptions);<o:p></o:p>


tag is used for any list label representation.


saveOptions.ExportListLabels = ExportListLabels.AsInlineText;<o:p></o:p>

doc.Save(@“test_p.html”, saveOptions);<o:p></o:p>


    tags are used for list label representation. Some formatting loss is possible.

saveOptions.ExportListLabels = ExportListLabels.ByHtmlTags;<o:p></o:p>

doc.Save(@“test_tags.html”, saveOptions);<o:p></o:p>

Hi, Tahir.
I tried this option, but i need an ordered html list is
    with correct numbers.
    Can i get it ?

    Hi Alexander,

    Thanks for your inquiry. Your requirement can be achieved using counter-reset and counter-increment css properties with
      tag. Unfortunately, Aspose.Words does not support the requested feature at the moment. However, we had already logged this feature request as WORDSNET-7662 in our issue tracking system. You will be notified via this forum thread once this feature is available.

    We apologize for your inconvenience.

    Tahir, thanks

    The issues you have found earlier (filed as WORDSNET-7662) have been fixed in this .NET update and this Java update.

    This message was posted using Notification2Forum from Downloads module by aspose.notifier.