Click or drag to resize

RevisionCollection Class

Represents a collection of Revisions.
Inheritance Hierarchy
SystemObject
  SautinSoft.DocumentRevisionCollection

Namespace: SautinSoft.Document
Assembly: SautinSoft.Document (in SautinSoft.Document.dll) Version: 2024.12.16
Syntax
public sealed class RevisionCollection : IEnumerable<Revision>, 
	IEnumerable

The RevisionCollection type exposes the following members.

Properties
 NameDescription
Public propertyCode exampleCount Gets the number of Revisions contained in the RevisionCollection.
Public propertyCode exampleGroups Gets a collection of revision groups.
Public propertyCode exampleItem Gets the Revision at the specified index.
Top
Methods
 NameDescription
Public methodCode exampleAcceptAll Accepts all revisions in this collection.
Public methodGetEnumerator Gets an enumerator that iterates through the collection.
Public methodCode exampleRejectAll Rejects all revisions in this collection.
Top
Example

See Developer Guide: How to work with revisions (tracked change)

How to work with revisions (tracked change) using C#
using SautinSoft.Document;

namespace Example
{
    class Program
    {
        static void Main(string[] args)
        {
            // Get your free 100-day key here:   
            // https://sautinsoft.com/start-for-free/

            Revision();
        }
        /// <summary>
        /// Shows how to work with revisions.
        /// </summary>
        /// <remarks>
        /// Details: https://sautinsoft.com/products/document/help/net/developer-guide/revision-track-changes-net-csharp-vb.php
        /// </remarks>
        static void Revision()
        {
            DocumentCore dc = DocumentCore.Load(@"..\..\..\example.docx");

            // Accepting the deletion revision will assimilate it into the paragraph's inlines and remove them from the collection.
            dc.Revisions[0].Accept();

            // The second insertion revision is now at index 0, which we can reject to ignore and discard it.
            dc.Revisions[0].Reject();

            // Now we have two revisions in the list items, we accept them all.
            dc.Revisions.AcceptAll();

            dc.Save(@"result.pdf");
            System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(@"result.pdf") { UseShellExecute = true });
        }
    }
}
How to work with revisions (tracked change) using VB.Net
Imports SautinSoft.Document

Namespace Example
    Friend Class Program
        Shared Sub Main(ByVal args() As String)
            Revision()
        End Sub
                ''' Get your free 100-day key here:   
                ''' https://sautinsoft.com/start-for-free/
        ''' <summary>
        ''' Shows how to work with revisions.
        ''' </summary>
        ''' <remarks>
        ''' Details: https://sautinsoft.com/products/document/help/net/developer-guide/revision-track-changes-net-csharp-vb.php
        ''' </remarks>
        Private Shared Sub Revision()
            Dim dc As DocumentCore = DocumentCore.Load("..\..\..\example.docx")

            ' Accepting the deletion revision will assimilate it into the paragraph's inlines and remove them from the collection.
            dc.Revisions(0).Accept()

            ' The second insertion revision is now at index 0, which we can reject to ignore and discard it.
            dc.Revisions(0).Reject()

            ' Now we have two revisions in the list items, we accept them all.
            dc.Revisions.AcceptAll()

            dc.Save("result.pdf")
            System.Diagnostics.Process.Start(New System.Diagnostics.ProcessStartInfo("result.pdf") With {.UseShellExecute = True})
        End Sub
    End Class
End Namespace
See Also