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

# Image captions

I know how to find all the images (via Shape nodes) in a document. What would be the best method to extract the captions for each of these?
- Todd

Hi
Thanks for your request. Captions are inserted right below of shapes. So I think that you can try getting text from the paragraph after shape. For example see the following code.

Document doc = new Document(@"Test141\in.doc");
NodeCollection shapes = doc.GetChildNodes(NodeType.Shape, true, false);
foreach (Shape shape in shapes)
{
string caption = shape.ParentParagraph.NextSibling.ToTxt();
}