We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

DocIO - Retrieve Caption for Image

Thread ID:





132647 Sep 13,2017 08:55 PM UTC Sep 14,2017 01:40 PM UTC ASP.NET Core 1
Tags: DocIO
Erik Burger
Asked On September 13, 2017 08:55 PM UTC


I am reading a Word document using DocIO and am trying to figure out how to read the Caption for an Image. The WPicture class has a method AddCaption but no method GetCaption or property Caption.

What I have noticed is that the Caption of an Image created in Word appears as a separate WParagraph, which makes things tricky. How can I tell which WParagraph instance contains the Caption text for a particular Image?

Please see an example of a Word document attached. What I am looking for is retrieving the "Google" text to save as part of the Image.

Using the AlternativeText is not an option as it does not support formatting (like hyperlinks, etc).



Mohanaselvam  Jothi [Syncfusion]
Replied On September 14, 2017 01:40 PM UTC

Hi Erik,

Thank you for using Syncfusion product.

In Microsoft Word, the image caption can be added above or below of the image. It is also possible to add multiple captions for an image. There is not references or a link between captions and its corresponding images. So, it is not feasible to get the image based on the image caption. The “Caption” paragraph style is used to define the caption of an image. So, you can identify the image captions based on “Caption” paragraph style.

Essential DocIO also performs the same as per Microsoft word behavior. So it is not feasible to retrieve caption of image.

We have prepared a workaround to meet your requirement with the help bookmark navigators. In this workaround sample, we have done the following things:
   1.Create a word document and add image.
   2.When creating image, bookmark is added to it.
   3.When adding caption for image, the bookmark is extended to its caption.
   4.Navigate to the image using BookmarksNavigator and retrieved the contents within a bookmark.
   5.Then, retrieve the caption text of the image within the bookmark.

Please find the sample which illustrates the same from below link, and let us know if this helps you.

We have not found any input document as mentioned in previous update. So kindly provide us your input Word document along with the details of working scenario which is used at your end. So that we can analyze further on your exact requirement and provide you the proper solution with the modified sample at the earliest.

Please let us know if you have any other questions.

Mohanaselvam J


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon