DocumentAcceptAllRevisions Method

Accepts all tracked changes in the document.

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


public void AcceptAllRevisions()



Shows how to accept all tracking changes in the document.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Edit the document while tracking changes to create a few revisions.
doc.StartTrackRevisions("John Doe");
builder.Write("Hello world! ");
builder.Write("Hello again! "); 
builder.Write("This is another revision.");

Assert.AreEqual(3, doc.Revisions.Count);

// We can iterate through every revision and accept/reject it as a part of our document.
// If we know we wish to accept every revision, we can do it more straightforwardly so by calling this method.

Assert.AreEqual(0, doc.Revisions.Count);
Assert.AreEqual("Hello world! Hello again! This is another revision.", doc.GetText().Trim());

See Also