ListFormatRemoveNumbers Method

Removes numbers or bullets from the current paragraph and sets list level to zero.

Namespace:  Aspose.Words
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public void RemoveNumbers()
Remarks

Calling this method is equivalent to setting the List property to null.

Examples
Removes bullets and numbering from all paragraphs in the main text of a section.
Body body = doc.FirstSection.Body;

foreach (Paragraph paragraph in body.Paragraphs.OfType<Paragraph>())
    paragraph.ListFormat.RemoveNumbers();
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