Articles in this section
Category / Section

How to create the deep level numbering( 1.1-1.2.1-1.2.2 etc.) using DocIO?

7 mins read

 

DocIO support  to create deep level numbering by specifying the Numberprefix and LineIndent property. The following code snippet illustrate how to create the list style for deep level numbering.

C#

//Add new list style to the document

ListStylestyleN = document.AddListStyle(ListType.Numbered, "ListStyleN");

//Create new level0 to the list

WListLevellistLevelL0 = styleN.Levels[0];

//Set the character and paragraph formating for the level

listLevelL0.CharacterFormat.FontSize = 16;

listLevelL0.CharacterFormat.Bold = true;

listLevelL0.CharacterFormat.Italic = true;

listLevelL0.ParagraphFormat.LeftIndent = 0;

listLevelL0.ParagraphFormat.FirstLineIndent = 20;

//Create a new level1 to the list

WListLevellistLevelL1 = styleN.Levels[1];

//Turns the numbering format to arabic

listLevelL1.IsLegalStyleNumbering = true;

//Numberprefix defines prefix before numbering.

//\x0000 - defines that numbering of the previous level will be inherited listLevelL1.NumberPrefix = "\x0000.";

//Set the indenting position of the level

listLevelL1.ParagraphFormat.LeftIndent = 70;

listLevelL1.ParagraphFormat.FirstLineIndent = -10;

 

WListLevellistLevelL2 = styleN.Levels[2];

listLevelL2.IsLegalStyleNumbering = true;

//\x0000.\x0001. - inherirs numbering of level 0 and 1

listLevelL2.NumberPrefix = "\x0000.\x0001.";

listLevelL2.ParagraphFormat.LeftIndent = 130;

listLevelL2.ParagraphFormat.FirstLineIndent = -40; 

 

VB

'Add new list style to the document

DimstyleN As ListStyle = document.AddListStyle(ListType.Numbered, "ListStyleN")

'Create new level0 to the list

DimlistLevelL0 As WListLevel = styleN.Levels(0)

'Set the character and paragraph formating for the level

listLevelL0.CharacterFormat.FontSize = 16

listLevelL0.CharacterFormat.Bold = True

listLevelL0.CharacterFormat.Italic = True

listLevelL0.ParagraphFormat.LeftIndent = 0

listLevelL0.ParagraphFormat.FirstLineIndent = 20

'Create a new level1 to the list

DimlistLevelL1 As WListLevel = styleN.Levels(1)

'Turns the numbering format to arabic

listLevelL1.IsLegalStyleNumbering = True

''Numberprefix defines prefix before numbering.

''\x0000 - defines that numbering of the previous level will be inherited

listLevelL1.NumberPrefix = ChrW(&H0).ToString() & "."

'Set the indenting position of the level

listLevelL1.ParagraphFormat.LeftIndent = 70

listLevelL1.ParagraphFormat.FirstLineIndent = -10

DimlistLevelL2 As WListLevel = styleN.Levels(2)

listLevelL2.IsLegalStyleNumbering = True

''\x0000.\x0001. - inherirs numbering of level 0 and 1

listLevelL2.NumberPrefix = ChrW(&H0).ToString() & "." & ChrW(&H1).ToString() & "."

listLevelL2.ParagraphFormat.LeftIndent = 130

listLevelL2.ParagraphFormat.FirstLineIndent = -40 

 

 

http://help.syncfusion.com/samples/DocIO.Windows/DocIO_DeepLevelNumbering/main.htm

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied