DocumentBuilderListFormat Property
Returns an object that represents current list formatting properties.

Namespace: Aspose.Words
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 19.12
Syntax
public ListFormat ListFormat { get; }

Property Value

Type: ListFormat
Examples
Shows how to apply default bulleted or numbered list formatting to paragraphs when using DocumentBuilder.
DocumentBuilder builder = new DocumentBuilder();

builder.Writeln("Aspose.Words allows:");
builder.Writeln();

// Start a numbered list with default formatting.
builder.ListFormat.ApplyNumberDefault();
builder.Writeln("Opening documents from different formats:");

// Go to second list level, add more text.
builder.ListFormat.ListIndent();
builder.Writeln("DOC");
builder.Writeln("PDF");
builder.Writeln("HTML");

// Outdent to the first list level.
builder.ListFormat.ListOutdent();
builder.Writeln("Processing documents");
builder.Writeln("Saving documents in different formats:");

// Indent the list level again.
builder.ListFormat.ListIndent();
builder.Writeln("DOC");
builder.Writeln("PDF");
builder.Writeln("HTML");
builder.Writeln("MHTML");
builder.Writeln("Plain text");

// Outdent the list level again.
builder.ListFormat.ListOutdent();
builder.Writeln("Doing many other things!");

// End the numbered list.
builder.ListFormat.RemoveNumbers();
builder.Writeln();

builder.Writeln("Aspose.Words main advantages are:");
builder.Writeln();

// Start a bulleted list with default formatting.
builder.ListFormat.ApplyBulletDefault();
builder.Writeln("Great performance");
builder.Writeln("High reliability");
builder.Writeln("Quality code and working");
builder.Writeln("Wide variety of features");
builder.Writeln("Easy to understand API");

// End the bulleted list.
builder.ListFormat.RemoveNumbers();

builder.Document.Save(ArtifactsDir + "Lists.ApplyDefaultBulletsAndNumbers.doc");
See Also