FindReplaceOptionsIgnoreInserted Property

Gets or sets a boolean value indicating either to ignore text inside insert revisions. The default value is false.

Namespace:  Aspose.Words.Replacing
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.10.0

ExpandedSyntax

public bool IgnoreInserted { get; set; }

Property Value

Type: Boolean

ExpandedExamples

Shows how to ignore text inside insert revisions.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Insert text with tracking revisions
doc.StartTrackRevisions("John Doe", DateTime.Now);
builder.Writeln("Inserted");
doc.StopTrackRevisions();

// Insert non-revised text
builder.Write("Text");

Regex regex = new Regex("e");
FindReplaceOptions options = new FindReplaceOptions();

// Replace 'e' in document while ignoring/not ignoring inserted text
options.IgnoreInserted = isIgnoreInserted;
doc.Range.Replace(regex, "*", options);

Assert.AreEqual(doc.GetText().Trim(), isIgnoreInserted ? "Inserted\rT*xt" : "Ins*rt*d\rT*xt");

ExpandedSee Also