Reputation: 1496
I am using office.js to build an Office 365 Word add-in. I need to insert an image with metadata (like an id) that I should be able to click on later and retrieve its metadata. Does anyone know if this is achievable with the current APIs? Looking through the documentation, I was only able to find a way to insert a base64-encoded image string.
Upvotes: 0
Views: 48
Reputation: 151
If I'm understanding correctly, you are looking for a way to insert images into the document with metadata. Then clicking on an image will return the metadata.
There's no direct way to insert an image with metadata but there are certainly some ways we can achieve similar behavior.
For e.g. Inserting the image into a content control, writing the metadata to the content control. When the content control is selected, it will return the metadata about the image.
Here's a sample that does just that: https://gist.github.com/AbidRahman-MSFT/090063807d3e7174acdb6e72e4504fcc
Upvotes: 1