Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Fri Jul 29, 2016 9:09 am

I need to have 2 bullet lists in a section.

Eligibility
1.
2.
3.

T & C
1.
2.
3.

How do I use the IsRestartNumbering to reset the Count?

Currently I get it as
Eligibility
1.
2.
3.

T & C
4.
5.
6.

Regards,
Ashish

[email protected]
 
Posts: 2
Joined: Thu Jul 14, 2016 11:12 am

Mon Aug 01, 2016 3:21 am

Dear Ashish,

Sorry for late reply as weekend.
Here is sample code for your reference.
Code: Select all
            //create a new doc document
            Document document = new Document();
            //add one section
            Section section = document.AddSection();

            //create a listStyle
            ListStyle listStyle = new ListStyle(document, ListType.Numbered);
            listStyle.Name = "levelstyle";
            listStyle.Levels[0].PatternType = ListPatternType.Arabic;     
            document.ListStyles.Add(listStyle);

            //create another listStyle
            ListStyle listStyle2 = new ListStyle(document, ListType.Numbered);
            listStyle2.Name = "levelstyle2";
            listStyle2.Levels[0].PatternType = ListPatternType.Arabic;
            document.ListStyles.Add(listStyle2);

            //apply the first style to the paragraph
            Paragraph paragraph = section.AddParagraph();
            paragraph.AppendText("One");
            paragraph.ListFormat.ApplyStyle("levelstyle");

            paragraph = section.AddParagraph();
            paragraph.AppendText("Two");
            paragraph.ListFormat.ApplyStyle("levelstyle");

            //apply the second style  to the paragraph
            paragraph = section.AddParagraph();
            paragraph.AppendText("one");
            paragraph.ListFormat.ApplyStyle("levelstyle2");

            paragraph = section.AddParagraph();
            paragraph.AppendText("Two");
            paragraph.ListFormat.ApplyStyle("levelstyle2");

            //Save doc file
            document.SaveToFile(@"8232result.docx", FileFormat.Docx);

If there is any question, welcome to get it back to us.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Mon Aug 01, 2016 6:23 am

Thank you Betsy! That did it :)

[email protected]
 
Posts: 2
Joined: Thu Jul 14, 2016 11:12 am

Mon Aug 01, 2016 7:05 am

Dear Ashish,

Thanks for your feedback.
Welcome to write to us again for further question.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Return to Spire.Doc

cron