Get Count and List of shapes in word document using JAVA

Hi team,

Requesting a work around solution to get the count and list of shapes

  • Images

  • Group Image (Consecutive images till a caption exists - to be considered as a single whole shape)

  • Charts

  • Images inside Table (To be considered as a single shape)

  • Equations

Regards
Priya Dharshini J PSample.zip (2.8 MB)
Sample2.zip (363.8 KB)

@priyadharshini

Thanks for your inquiry. You can iterate through the Shapes NodeCollection and use increment operator to count different types of shapes. Following documentation link shows how to extract and count the images, for charts you can use another increment operator and add if loop with shape.hasChart()

Extract images from a document

For group images you can check this forum post. You can use increment operator to count group images.

Extract group imags