Aspose word revisions

Hi all,

I want to find the level of the revisions on the word.
Exampl:
1.2.3.4 title 4
i want to have 1.2.3.4

with this code:
foreach (Revision revision in doc.Revisions)
{

}

Best regards,
Jugurtha

@Jugurtha_MAHDAD Do you want to determine the revisions sequence number?

int revisionIndex = 0;
foreach (Revision revision in doc.Revisions)
{
    
    revisionIndex++;
}

If not, please explain in more detail.

image.png (5.6 KB)

for exampl on this revision, i want to determine that the revision is on the title 6.4.2,
with visual basic we can determine that is the section 6, but my customer want to know exactly the lowest level of the modification.

Best regards,

@Jugurtha_MAHDAD Please consider the following code.

doc.UpdateListLabels();
foreach (Revision revision in doc.Revisions)
{
    Paragraph para = revision.ParentNode.ParentNode as Paragraph;
    if (para != null && para.IsListItem)
        Console.WriteLine(para.ListLabel.LabelString);
}

Hi Vadim,
this is working when i do a revision on a title like this picture:
image.png (1.2 KB)

But it is not working when i do a revision on the paragraphe of this title like below:
image.png (19.8 KB)

this is te problem if (para != null && para.IsListItem), the revision.parentNode.parentNode is not listItem, the attribute IsListItem is false

Best regards,
Jugurtha

@Jugurtha_MAHDAD What you pointed in the second screenshot is not one paragraph, but at least six.
The code above demonstrates how to get ListLabel of a particular paragraph.
Here I have provided the example of how to determine the presence of revisions in a given paragraph.
By combining these approaches, you can easily achieve results in more complex cases.