Search code examples
c#.netnpoi

NPOI Word creating numbered list


As NPOI is not that great with documentation, I am posting this question. Is it possible to create numbered list using NPOI library for .NET?

  1. test 1
  2. test 2
  3. and so on....

There is an example for creating bullet point list. However could not find example which would use numbers,but not bullet point


Solution

  • In that example you have provided just remove this line

    string abstractNumId = numbering.AddAbstractNum();

    (line 18) and set

    string numId = numbering.AddNum("1");

    and it should work as you need