NodeRange Property

Returns a Range object that represents the portion of a document that is contained in this node.

Namespace:  Aspose.Words
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 21.7.0


public Range Range { get; }

Property Value

Type: Range


Shows how to delete all the nodes from a range.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Add text to the first section in the document, and then add another section.
builder.Write("Section 1. ");
builder.Write("Section 2.");

Assert.AreEqual("Section 1. \fSection 2.", doc.GetText().Trim());

// Remove the first section entirely by removing all the nodes
// within its range, including the section itself.

Assert.AreEqual(1, doc.Sections.Count);
Assert.AreEqual("Section 2.", doc.GetText().Trim());

ExpandedSee Also