How to get the ImageFile Name present in the Document using Aspose.Word

Hi,
I am doing a small POC using Aspose.Word.
I am facing a small Issue, hope you may help me with this.
Actually I am loading one doc file using Aspose.Word.
Then I want to get the images present in that file with their name.

I am creating that document using Aspose.Word using and document template and using the mailmerge filed I am assigning the image and image Name there.
Please refer below for details.

«TableStart:testAttachmentInfo»
«Image:objectPath»
«objectFileName»
«TableEnd:testAttachmentInfo»
While generating the document from template I am assigning the image and image name.
Please refer below for the document generated.

Again due to some requirement I am loading the genearted document using Aspose.Word and I need the images present with the name i.e “loading.gif” ihis case.
I am using the below code.
foreach (Section sec in doc.Sections) { NodeCollection shapes = doc.GetChildNodes(NodeType.Shape, true); foreach (Shape shape in shapes) { if (shape.HasImage) { string fileextension = FileFormatUtil.ImageTypeToExtension(shape.ImageData.ImageType).ToLower();
I am using the above code and getting the file extension of image file.
However I have used ImageData.Title and also tried with Shape.Name, however not getting the file name.
Could you please help me in achieving the same?
Please revert in case of any issue.
Thanks,
Rajesh

Hi Rajesh,

Thanks for your inquiry. Could you please attach your Word document you want to get image file names from here for testing? We will investigate the issue on our end and provide you more information.

Best regards,

Hi Awais,

We are able to get the requirement done in another method.

Thanks for your quick response on this.
Regards,
Rajesh

Hi Rajesh,

It is great you were able to find what you were looking for. Please let us know any time you have any further queries.

Best regards,