Back to Devexpress

Document.Revisions Property

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-document-8d19145b.md

latest4.8 KB
Original Source

Document.Revisions Property

Provides access to the collection of revisions made in the current document.

Namespace : DevExpress.XtraRichEdit.API.Native

Assembly : DevExpress.RichEdit.v25.2.Core.dll

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
RevisionCollection Revisions { get; }
vb
ReadOnly Property Revisions As RevisionCollection

Property Value

TypeDescription
RevisionCollection

A RevisionCollection object that is the revision collection.

|

Remarks

Use the Revisions property to access a collection of revisions or a specific revision by its index.

You can accept or reject all revisions, or pass a specific Predicate<T> to the AcceptAll or RejectAll method to accept or reject revisions with given parameters.

The code sample below shows how to accept all revisions from a specific author made on the specified date:

csharp
using (RichEditDocumentServer wordProcessor = new RichEditDocumentServer())
{
  DateTime dateTime = new DateTime(2019,9,2);
  wordProcessor.Document.Revisions.AcceptAll(x=> x.Author == "Nancy Davolio" && x.DateTime == dateTime);
}
vb
Using wordProcessor As New RichEditDocumentServer()
  Dim dateTime As New Date(2019,9,2)
  wordProcessor.Document.Revisions.AcceptAll(Function(x) x.Author = "Nancy Davolio" AndAlso x.DateTime = dateTime)
End Using

The following code snippets (auto-collected from DevExpress Examples) contain references to the Revisions property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

word-document-api-use-track-changes/CS/word-processing-document-api-track-changes/Program.cs#L34

csharp
RevisionCollection documentRevisions = documentProcessor.Document.Revisions;

winforms-rich-edit-manage-tracked-changes/CS/XtraRichEdit_TrackChanges/Form1.cs#L45

csharp
{
    RevisionCollection documentRevisions = richEditControl1.Document.Revisions;

wpf-richedit-manage-tracked-changes/CS/DXRichEdit_TrackChanges/MainWindow.xaml.cs#L28

csharp
{
    RevisionCollection documentRevisions = richEditControl1.Document.Revisions;

word-document-api-use-track-changes/VB/word-processing-document-api-track-changes/Program.vb#L31

vb
Dim documentRevisions As RevisionCollection = documentProcessor.Document.Revisions

winforms-rich-edit-manage-tracked-changes/VB/XtraRichEdit_TrackChanges/Form1.vb#L38

vb
Private Sub AcceptAndRejectRevisions()
    Dim documentRevisions As RevisionCollection = richEditControl1.Document.Revisions
    'Reject all revisions in the firts page's header:

See Also

Document Interface

Document Members

DevExpress.XtraRichEdit.API.Native Namespace