FindReplaceOptionsIgnoreDeleted Property

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

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

ExpandedSyntax

public bool IgnoreDeleted { get; set; }

Property Value

Type: Boolean

ExpandedExamples

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

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

// Remove first paragraph with tracking revisions
doc.StartTrackRevisions("John Doe", DateTime.Now);
doc.FirstSection.Body.FirstParagraph.Remove();
doc.StopTrackRevisions();

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

// Replace 'e' in document while ignoring/not ignoring deleted text
options.IgnoreDeleted = isIgnoreDeleted;
doc.Range.Replace(regex, "*", options);

Assert.AreEqual(doc.GetText().Trim(), isIgnoreDeleted ? "Deleted\rT*xt" : "D*l*t*d\rT*xt");

ExpandedSee Also