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 Mar 25, 2016 6:00 pm

The list number work great. But in most documents, the list number is a heading followed by a block of text. But once I'm in a List Number format, it's hard to get out of it.

I tried this, but each NewLine creates another List Number.

paragraph = section.AddParagraph();
paragraph.AppendText("A sub-sub-item" + Environment.NewLine);
paragraph.ApplyStyle(BuiltinStyle.Heading5);
paragraph.ListFormat.ListLevelNumber = 2;
paragraph.ListFormat.ApplyStyle("levelstyle");

Here's basically what I am trying to do . . .

1.2.3 Overview
........Block of text describing the overview.
........Should display over multiple lines without causing more List Numbers to display.
........Then after the Overview, I want List Numbering to continue.

1.2.4 Scope of Work

(I used ........ because the Forum can't display leading spaces.)

Is there any documentation on the order in which the functions should be called? And/or any documentation on how to turn on/off List Numbers properly to achieve my example?

Thanks!

dave.holly@verizon.net
 
Posts: 3
Joined: Sat Mar 19, 2016 2:02 am

Mon Mar 28, 2016 2:12 am

Hi,

Thanks for your posting.
Please use "\v" to start new line .
Sample code:
Code: Select all
 paragraph.AppendText("A sub-sub-item" );
            TextRange range = paragraph.AppendText("\vthis is a testing text");
            paragraph.ApplyStyle(BuiltinStyle.Heading5);
            paragraph.ListFormat.ListLevelNumber = 2;
            paragraph.ListFormat.ApplyStyle("levelstyle");
            //set text's font style, for example
            range.CharacterFormat.Bold = false;         


Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2767
Joined: Wed Jun 27, 2012 8:50 am

Thu Mar 31, 2016 7:59 am

Hi,

Has your issue been resolved?
Thanks for your feedback in advance.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2767
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.Doc

cron