We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to determine the location of shapes

Hi,



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.


Thanks
Manisha

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");

doc.setTrackRevisions(true);

doc.startTrackRevisions("tahir");

Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);

shape.remove();

doc.stopTrackRevisions();

doc.save(MyDir + "Out.docx");