Get lists in word using c#

Home Forums WordprocessingML Get lists in word using c#

This topic contains 2 replies, has 2 voices, and was last updated by 1 year, 1 month ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #4308

    How to fetch bullet/numbered lists using c# ?


    Eric White

    There is the ListItemRetriever module in Open-Xml-PowerTools, which will return the list item (the actual numbering / bulleting) for any paragraph in a document. This module is used by the WmlToHtmlConverter module, which converts a document to HTML that is formatted with CSS.

    What are you doing with the bulleted / numbered lists? What is your scenario?


    Hi Eric,
    I need to fetch all lists from documents, with their parents. For Instance ,

    Companies List:-
    1. ABC
    2. XYZ
    3. KLM.
    Places to visit :-
    1. International Space Station(ISS)
    2. Poles of Earth

    I need to make them sort like,
    Public Class Parent

    public string Name{get;set;}
    public HashSet<Children>childrens{get;set;}
    HashSet<Parent> parentModel= new HashSet<Parent>();
    using (WordprocessingDocument doc = WordprocessingDocument.Open(docxFile, true))
    Body body = doc.MainDocumentPart.Document.Body;
    foreach (Paragraph paragraph in paragraphs)

    parent.Name= paragraph.InnerText;
    model.parents = parentlist;
    //Thats how I got parent But I want child like that
    Parent[0] Companies List
    Parent[1] Places to visit
    Child[0]International Space Station(ISS)
    Child[1]Poles of Earth

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.