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.

Wed Apr 20, 2016 8:32 am

After I get a paragraph,I want to get the listlevelnumber and suffix text of the paragraph such as "a)". I just can not get the api .

iceblueDDX123
 
Posts: 34
Joined: Tue Apr 19, 2016 9:43 am

Wed Apr 20, 2016 8:58 am

Hi,

Please use the code.
Code: Select all
paragraph.ListFormat.CurrentListLevel.NumberSufix


Best Regards,
Amy
E-iceblue support team
User avatar

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

Tue May 03, 2016 2:05 am

amy.zhao wrote:Hi,

Please use the code.
Code: Select all
paragraph.ListFormat.CurrentListLevel.NumberSufix


Best Regards,
Amy
E-iceblue support team

I just have get the " '\ " from " a\ this is a para",but the character "a" is what I want to get.

iceblueDDX123
 
Posts: 34
Joined: Tue Apr 19, 2016 9:43 am

Tue May 03, 2016 2:16 am

amy.zhao wrote:Hi,

Please use the code.
Code: Select all
paragraph.ListFormat.CurrentListLevel.NumberSufix


Best Regards,
Amy
E-iceblue support team

For example ,the paragraph is below:
"a: this is a para."
and I want to get the character "a" not ":".

iceblueDDX123
 
Posts: 34
Joined: Tue Apr 19, 2016 9:43 am

Tue May 03, 2016 3:21 am

Hi,

Please try the following solution.
Code: Select all
   Paragraph p = section.Paragraphs[0];
            string listText = p.ListText;
            int lastIndex = listText.ToCharArray().Count()-1;
            string value = listText.Remove(lastIndex);


Hope this answers your question. Let me know if further detail would be helpful.

Best Regards,
Amy
E-iceblue support team
User avatar

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

Return to Spire.Doc