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: 20.5
Syntax
public Range Range { get; }

Property Value

Type: Range
Examples
Shows how to delete all characters of a range.
// Insert two sections into a blank document
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

builder.Write("Section 1. ");
builder.InsertBreak(BreakType.SectionBreakContinuous);
builder.Write("Section 2.");

// Verify the whole text of the document
Assert.AreEqual("Section 1. \fSection 2.", doc.GetText().Trim());

// Delete the first section from the document
doc.Sections[0].Range.Delete();

// Check the first section was deleted by looking at the text of the whole document again
Assert.AreEqual("Section 2.", doc.GetText().Trim());
See Also