Getting extra revisions when comparing two word documents

Hi,

We need to compare two word documents and for this feature, we are using Document.compare(Document, User, Date) API.

We tried to evaluate this API with a specific scenario, where a Smart Art is inserted in the middle of document.

In the revision document, we are seeing two modification one for Smart Art insertion and another for some formatting changes. Ideally, we should get only one revision regarding Smart Art insertion as there is no format changes.

The code used for this feature is given below:

Document doc1=new Document(“10kPart.docx”);
Document doc1=new Document(“10kPart_SmartArtInserted.docx”);
doc1.compare(doc2,“Manisha”,new Date());
doc1.save(“rev_10kPart_SmartArtInserted.docx”);

The revisions we got are:

Revisions:
1: Revision[type: 2: FORMAT_CHANGE, parent-node: [Unknown!]
2: Revision[type: 0: INSERTION, parent-node: [Unknown!]
3: Revision[type: 0: INSERTION, parent-node: [Shape: Name: Diagram 1, Alt: ]

In above revisions list, first and second seems to be extraneous.

The documents are attached for your reference.

Please help us in resolving this issue as soon as possible.


Thanks
Manisha

Hi Manisha,


Thanks for your inquiry. I have attached a compared document which was produced by using MS Word 2013 on my side here for your reference. You’ll see MS Word adds a FORMAT_CHANGE revision too. So, this seems to be an expected behavior. If we can help you with anything else, please feel free to ask.

Best regards,