user2921973
user2921973

Reputation: 77

office add-in commands button icon images not showing up

I have created a Office web addin for Excel, which creates a custom tab with Addin command buttons, the icons which appear on the custom tab always show up with a blue video camera kind of image like shown below, even though the icon I specified in manifest xml file exists with a different image like the one shown underneath the first image

I verified the image url specified in the manifest xml file in the browser and it shows the right image

Please help, Thanks in advance Ira

Wrong image on icons Image1

Correct image which should come up

enter image description here

Upvotes: 2

Views: 2099

Answers (2)

dotNET
dotNET

Reputation: 35380

In case this helps anyone, Office add-ins do not appear to work with image resources located on localhost. You have to use a publicly available address for the images. Here is my config:

  • A Vue CLI + Office.js project
  • Office 2019 (standard desktop)
  • Using npm run serve with https://localhost:8080 setting
  • manifest file is syntactically correct as per docs

As long as my images reside on localhost, Word refuses to load them and instead shows the blue fallback icons. As soon as I move them to a public host and change their URL in the manifest, the icon appears correctly.

Also note that validate also fails for my manifest file when using localhost url for the icon. Looks like this script invokes an online service that tries to fetch icon URL (and obviously can't find the locally hosted content).

Update

~remoteAppUrl must be replaced with the actual URL of the add-in. Appears to work correctly for both local and Internet-based URLs in Word 2019.

Upvotes: 1

Michael Zlatkovsky
Michael Zlatkovsky

Reputation: 8670

Can you share your manifest? Do the icon URLs point to http or https? (It should be https)

Upvotes: 3

Related Questions