We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Nested Sublists

Hi,


Is there any way to nest sublists like the following for ListTemplate.NumberDefault?

Note the nesting. When I do this by specifying number default for both, i still get the next list as NumberLowercaseLetterDot

Thanks

1. 1.
AN AFFIDAVIT FOR *** MUST BE RECORDED WITH THE CLERK AND
RECORDER OF THE COUNTY WHERE THE PROPERTY IS LOCATED.
SAID AFFIDAVIT:

<o:p></o:p>

1. TO BE EXECUTED BY ANY ONE OR MORE TRUSTEES.

2. TO CONTAIN THE NAME OF THE TRUST.

3. TO CONTAIN THE NAMES AND ADDRESSES OF ALL TRUSTEES WHO ARE REPRESENTED BY SUCH NAME.

4. TO CONSTITUTE PRIMA FACIE EVIDENCE OF:

a. THE FACT RECITED THEREIN.

b.THE AUTHORITY OF THE AFFIANT TO EXECUTE AND RECORD THE AFFIDAVIT.

c. THE AUTHORITY OF THE TRUSTEES WHO ARE THEREBY EMPOWERED TO
CONVEY OR ENCUMBER THE PROPERTY.



end up with this (ignore other formatting, bold, etc)

  1. AN AFFIDAVIT FOR *** MUST BE RECORDED WITH THE CLERK AND RECORDER OF THE COUNTY WHERE THE PROPERTY IS LOCATED. SAID AFFIDAVIT:
    1. TO BE EXECUTED BY ANY ONE OR MORE TRUSTEES.
    2. TO CONTAIN THE NAME OF THE TRUST.
    3. TO CONTAIN THE NAMES AND ADDRESSES OF ALL TRUSTEES WHO ARE REPRESENTED BY SUCH NAME.
    4. TO CONSTITUTE PRIMA FACIE EVIDENCE OF:

i. THE FACT RECITED THEREIN.

ii. THE AUTHORITY OF THE AFFIANT TO EXECUTE AND RECORD THE AFFIDAVIT.

iii. THE AUTHORITY OF THE TRUSTEES WHO ARE THEREBY EMPOWERED TO CONVEY OR ENCUMBER THE PROPERTY.



Just to add, the numbering is fine if I don’t specify a listlevel number or indent. Either of these actions cause the list format type to be ignored for the sublists

I think i found my answer here thanks…


Multilevel Lists

Hi Bruno,

Thanks for your inquiry. It is nice to hear from you that you have found the solution of your issue. Please check the following code examples for your kind reference.


Document
doc = new Document();

// Create a list based on one of the Microsoft Word list templates.

Aspose.Words.Lists.List list = doc.Lists.Add(ListTemplate.NumberDefault);

// Completely customize one list level.

ListLevel level1 = list.ListLevels[0];

level1.NumberStyle = NumberStyle.OrdinalText;

level1.NumberFormat = "1";

// Completely customize yet another list level.

ListLevel level2 = list.ListLevels[1];

level2.NumberFormat = "1.1";

// Completely customize yet another list level.

ListLevel level3 = list.ListLevels[2];

level3.NumberFormat = "1.1.1";

DocumentBuilder builder = new DocumentBuilder(doc);

builder.ListFormat.List = list;

builder.Writeln("The quick brown fox...");

builder.ListFormat.ListIndent();

builder.Writeln("jumped over the lazy dog.");

builder.ListFormat.ListIndent();

builder.Writeln("jumped over the lazy dog.");

builder.ListFormat.ListOutdent();

builder.Writeln("The quick brown fox...");

builder.ListFormat.RemoveNumbers();

builder.Document.Save(MyDir + "Lists.CreateCustomList Out.doc");

doc.Save(MyDir + "Out.docx");


<!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>AR-SA</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val="–"/>
<m:smallFrac m:val=“off”/>
<m:dispDef/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>
</m:mathPr></w:WordDocument>
<![endif]–><!–[if gte mso 10]>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;}

<![endif]–>Following code example Shows how to specify list level number when building a list using DocumentBuilder.


Document
doc = new Document();

DocumentBuilder builder = new DocumentBuilder(doc);

// Create a numbered list based on one of the Microsoft Word list templates and

// apply it to the current paragraph in the document builder.

builder.ListFormat.List = doc.Lists.Add(ListTemplate.NumberArabicDot);

// There are 9 levels in this list, lets try them all.

for (int i = 0; i < 9; i++)

{

builder.ListFormat.ListLevelNumber = i;

builder.Writeln("Level " + i);

}

// Create a bulleted list based on one of the Microsoft Word list templates

// and apply it to the current paragraph in the document builder.

builder.ListFormat.List = doc.Lists.Add(ListTemplate.BulletDiamonds);

// There are 9 levels in this list, lets try them all.

for (int i = 0; i < 9; i++)

{

builder.ListFormat.ListLevelNumber = i;

builder.Writeln("Level " + i);

}

// This is a way to stop list formatting.

builder.ListFormat.List = null;

builder.Document.Save(MyDir + "Lists.SpecifyListLevel Out.doc");


Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.