How to determine the location of shapes


We have a requirement to locate the shapes/group shapes in word document. Consider the scenario that there are a group of contiguous shapes spanning across multiple lines say four lines in paragraph three of page two. Now one of the shape got deleted from line three. Now we want to put a bar to the very left hand side of line three which will indicate that shape is deleted from that line. Could you please suggest some way of doing this.

Any help will be appreciated.


Hi Manisha,

Thanks for your inquiry. Your query seems to be related to track changes in document. Please use Document.StartTrackRevisions method to start automatically marking all further changes you make to the document programmatically as revision changes.

If you call this method and then make some changes to the document programmatically, save the document and later open the document in MS Word you will see these changes as revisions.

Please check following code example for your kind reference. Hope this helps you. Please let us know if you have any more queries.

Document doc = new Document(MyDir + "in.docx");
Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
doc.stopTrackRevisions(); + "Out.docx");