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

Free Support Forum - aspose.com

How to import only referenced images?


Please look attached word file.

This is reference document. I want to import data between [IMAGE] and [/IMAGE]. How to import only this image from another document? I dont want to import all images from reference document.




Thanks for your request. I think that you can try to use the following code to achieve this.

Document doc = new Document(@"323_100891_isrc\in.doc");

NodeCollection shapes = doc.GetChildNodes(NodeType.Shape, true);

foreach (Shape shape in shapes)


//if previouse paragraph is [IMAGE] then save image

if (shape.ParentParagraph.PreviousSibling.Range.Text.Contains("[IMAGE]"))





I hope that this will help you.

Best regards.