Class RevisionCollection
Represents the collection of Revision in the Word document.
Inherited Members
      System.Object.Equals(System.Object)
    
      System.Object.Equals(System.Object, System.Object)
    
      System.Object.GetHashCode()
    
      System.Object.GetType()
    
      System.Object.MemberwiseClone()
    
      System.Object.ReferenceEquals(System.Object, System.Object)
    
      System.Object.ToString()
    
Namespace: Syncfusion.DocIO.DLS
Assembly: Syncfusion.DocIO.Base.dll
Syntax
public class RevisionCollection : CollectionImpl, ICollectionBase, IEnumerableProperties
Item[Int32]
Gets the Revision at the specified index.
Declaration
public Revision this[int index] { get; }Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | index | The integer that represents the position of the revision in the document to get. | 
Property Value
| Type | Description | 
|---|---|
| Revision | The Revision at the specified index. | 
Examples
//Loads an existing Word document
WordDocument document = new WordDocument("Template.docx");
//Gets the revision from the revision collections                
Revision revision = document.Revisions[0];
//If the revision is formatting type of revision, then accept it
if (revision.RevisionType == RevisionType.Formatting)
     revision.Accept();              
//Saves and closes the Word document
document.Save("Sample.docx", FormatType.Docx);
document.Close(); 
'Loads an existing Word document 
Dim document As WordDocument = New WordDocument("Template.docx")
'Gets the revision from the revision collections               
Dim rev As Revision = document.Revisions(0)
'If the revision is formatting type of revision, then accept it
If rev.RevisionType Is RevisionType.Formatting Then rev.Accept()
'Saves and closes the Word document
document.Save("Sample.docx", FormatType.Docx)
document.Close()Exceptions
| Type | Condition | 
|---|---|
| System.ArgumentOutOfRangeException | The index is not valid in the RevisionCollection | 
Methods
AcceptAll()
Accepts all the tracked changes in a document or range. The revision marks are removed, and the changes are incorporated into the document.
Declaration
public void AcceptAll()Examples
//Load an existing Word document into DocIO instance.
WordDocument document = new WordDocument("Template.docx");
//get all the revisions from the revision collection and accepts all.
document.Revisions.AcceptAll();      
//Save and Close the Word document.
document.Save("Sample.docx", FormatType.Docx);
document.Close();        
'Load an existing Word document into DocIO instance.
 Dim document As WordDocument = New WordDocument("Template.docx")
 'Get all the revision from the revision collection and accepts all.      
 document.Revisions.AcceptAll()
 'Save and Close the Word document.
 document.Save("Sample.docx", FormatType.Docx)
 document.Close()RejectAll()
Rejects all the tracked changes in a range. The revision marks are removed, leaving the original text intact.
Declaration
public void RejectAll()Examples
//Load an existing Word document into DocIO instance.
WordDocument document = new WordDocument("Template.docx");
//get all the revisions from the revision collection and reject all.
document.Revisions.RejectAll();      
//Save and Close the Word document.
document.Save("Sample.docx", FormatType.Docx);
document.Close();        
'Load an existing Word document into DocIO instance.
 Dim document As WordDocument = New WordDocument("Template.docx")
 'Get all the revisions from the revision collection and reject all.       
 document.Revisions.RejectAll()
 'Save and Close the Word document.
 document.Save("Sample.docx", FormatType.Docx)
 document.Close()Implements
      System.Collections.IEnumerable