range property
Node.range property
Returns a Range object that represents the portion of a document that is contained in this node.
get range(): Aspose.Words.Range
Examples
Shows how to delete all the nodes from a range.
let doc = new aw.Document();
let builder = new aw.DocumentBuilder(doc);
// Add text to the first section in the document, and then add another section.
builder.write("Section 1. ");
builder.insertBreak(aw.BreakType.SectionBreakContinuous);
builder.write("Section 2.");
expect(doc.getText().trim()).toEqual("Section 1. \fSection 2.");
// Remove the first section entirely by removing all the nodes
// within its range, including the section itself.
doc.sections.at(0).range.delete();
expect(doc.sections.count).toEqual(1);
expect(doc.getText().trim()).toEqual("Section 2.");
See Also
- module Aspose.Words
- class Node