Linked images using <img> tags in Word desktop don't roundtrip to Word Online
I'm developing an add-in for Word 2016 and online Word.
In it, on the desktop version of Word, if I insert html content using document.setSelectedDataAsync with an image tag and URL to an image on our server, the image displays on the desktop version of Word. If I save the same file to OneDrive and show it on the online version of Word, the image does not display. If I wrap the image in an <a> tag with a link, the link shows up when I hover over the image in the online version of Word, but the image never appears. If I modify the file, save it back to OneDrive, open the file in the desktop version of Word, the image does appear.
Since I'd prefer to do html embed with hyperlinks, I also tried creating an <img> tag with a local base64 DataURI for the image, while perfect valid, that failed to display in either the desktop or online version of Word.
I'd like this functionality to allow for both live updating of images in documents as well as linking to our web app to edit the images.
If instead I get the actual image, convert it to a Base64 encoded image and insert an image (coercing the type in document.setSelectedDataAsync to image), the image displays on both desktop and online, but we lose the auto-updating and hyperlinking features.
Trying the same thing with other add-ins, for example the Wikipedia add-in for Word, I see exactly the same issue. If you use the plug-in on the desktop version of word and add an image from the plugin, then save the file to OneDrive, then open the file on the online version of Word, the image will not display.
It seems to me that there is a fundamental issue with roundtripping html-based content with external links from the desktop version of Word 2016 to the online version.
Way, thanks for reporting this, it’s greatly appreciated! We’re currently investigating this issue. We’ll keep you posted with our findings.
Office Extensibility Team