Inserting images from an office add-in and keeping track of them.

Jack Steel 0 Reputation points
2024-09-27T14:40:03.0733333+00:00

This is my first office add-in project so please do provide as much information as you like that might help.

I'm trying to have my office add-in insert images into a word document, these images are generated on the fly by a backend service and I currently grab the base64 encoding and use insertInlinePictureFromBase64 to add it to the document. The next feature I want requires being able to keep track of the images the add-in has inserted so that they can be updated later either via a right-click context menu or a task pane button without the user having to figure out which image in the document corresponds to the newer version of that image from the taskpane.

The problem I'm running into is that there doesn't seem to be any way (at least in the docs or after searching for a few hours) to either store some kind of queryable metadata with the image when it is inserted, or to get some kind of unique identifier for the image.

I know that the insertInlinePictureFromBase64 method returns the inserted image object which could be stored in memory for these kind of updates, but ideally I'd like the solution to work between document/add-in reloads.

Please let me know if anyone has any ideas on solving this or pointers to docs that might help with this, thanks in advance!

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,926 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.