Hi.
Help me to understand revisions in Aspose.Words.
I created a simple docx in Ms Word with table, enabled track changes and changed column width.
In RevisionCollection for this document: 1 Revision without Group and 1 RevisionGroup. Why? In which cases is the group field missing in the revision?
Code:
var wordDoc = new Aspose.Words.Document(Environment.CurrentDirectory + "/1.docx");
var trackChanges = wordDoc.Revisions;
Console.WriteLine("Count revision groups: " + trackChanges.Groups.Count);
Console.WriteLine("Single revision group: " + trackChanges.Single().Group);
Output:
Count revision groups: 1
Single revision group:
And I have another question: how to create a revision with revision type StyleDefinitionChange? All the style edits I’ve tried create only FormatChange revisions.
@asposeuuups RevisionGroup
groups sequential Revision objects. It was introduced for convenience, because MS Word UI often shows several sequential revisions as a single revision.
The behavior you have described looks like a bug and I managed to reproduce this problem on my side. For a sake of correction it has been logged as WORDSNET-24018. We will keep you informed and let you know once it is resolved.
1 Like
@alexey.noskov thanks, can you help with second question: how to create a revision with revision type StyleDefinitionChange?
@asposeuuups I looked through the code and it looks like StyleDefinitionChange
is ODT format feature. So you cannot create revision of such type in MS Word.
StyleDefinitionChange revision can be created in docx. Create one document, copy it and change one of the used styles, then compare both documents and you will get the document with revision with revision type StyleDefinitionChange.
@asposeuuups Thank you for correcting me. You are right. Excuse me misinforming you.
1 Like
The issues you have found earlier (filed as WORDSNET-24018) have been fixed in this Aspose.Words for .NET 22.8 update also available on NuGet.