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.

Tue Apr 02, 2024 11:22 am

Hi,

Looking at the tutorial "Manage Word Headings to Form a Catalogue", I noticed that the that the number prefix is hard-coded with the instruction:
Code: Select all
 listLev.NumberPrefix = "1.1."


I would like the number prefix to be automatic depending on the number of the parent heading.
Is this possibile?

Thanks,

Francesco

f.mazzurco
 
Posts: 13
Joined: Thu Aug 30, 2018 7:57 am

Wed Apr 03, 2024 2:13 am

Hi,

Thanks for your inquiry.
Spire.Doc adheres to Microsoft specifications, the effect of the ListStyle object is similar to the style in the screenshot below, and the effect of listLev.NumberPrefix is to set the prefix of the style.
555.png


If the document has three Heading 1,
(1) Creating a ListStyle object with prefix (1.1), then set the ListStyle to this three Heading 1, the prefixs of these Heading 1 are “1.1.1、1.1.2、1.1.3”,

(2) Creating a ListStyle object with prefix (2.2), then set the ListStyle to this three Heading 1, the prefixs of these Heading 1 are “2.2.1、2.2.2、2.2.3”,

The number prefix is automatic depending on the number of the parent heading. Can you make sense of what I say?

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 994
Joined: Tue Mar 08, 2022 2:02 am

Return to Spire.Doc

cron