Reputation: 123
I am working on office addin where I have added a control on a custom tab. but the control does not show the Icon image specified instead it shows default icon.
So how can we show the icon specified for each control in ribbon ?
Reffered link: link
Following is the ribbon image showing default icon :
Manifest.xml file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="TaskPaneApp">
<Id>81d7e91a-c8e6-454f-806a-9b84cf3e7dd5</Id>
<Version>1.0.0.0</Version>
<ProviderName>Contoso</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="Add-in"/>
<Description DefaultValue="A template to get started."/>
<IconUrl DefaultValue="https://localhost:3000/assets/icon-32.png"/>
<HighResolutionIconUrl DefaultValue="https://localhost:3000/assets/icon-64.png"/>
<SupportUrl DefaultValue="https://www.contoso.com/help"/>
<AppDomains>
<AppDomain>https://www.contoso.com</AppDomain>
</AppDomains>
<Hosts>
<Host Name="Workbook"/>
</Hosts>
<DefaultSettings>
<SourceLocation DefaultValue="https://localhost:3000/taskpane.html"/>
</DefaultSettings>
<Permissions>ReadWriteDocument</Permissions>
<VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
<Hosts>
<Host xsi:type="Workbook">
<DesktopFormFactor>
<FunctionFile resid="Commands.Url"/>
<ExtensionPoint xsi:type="PrimaryCommandSurface">
<CustomTab id="CustomTab">
<Label resid="ribbonNameLabel" />
<Group id="AuthGroup">
<Label resid="AuthGroupNameLabel" />
<Icon>
<bt:Image size="16" resid="Group1LoginIcon16" />
<bt:Image size="32" resid="Group1LoginIcon32" />
<bt:Image size="80" resid="Group1LoginIcon80" />
</Icon>
<Control xsi:type="Button" id="LoginControl">
<Label resid="LoginButtonLabel" />
<Supertip>
<Title resid="LoginButtonToolTipTitle" />
<Description resid="LoginButtonToolTipDescription" />
</Supertip>
<Icon>
<bt:Image size="16" resid="Group1LoginIcon16" />
<bt:Image size="32" resid="Group1LoginIcon32" />
<bt:Image size="80" resid="Group1LoginIcon80" />
</Icon>
<Action xsi:type="ShowTaskpane">
<TaskpaneId>LoginPanelId</TaskpaneId>
<Title resid="LoginTaskPaneTitle" />
<SourceLocation resid="LoginTaskPaneUrl" />
</Action>
</Control>
</Group>
</CustomTab>
</ExtensionPoint>
</DesktopFormFactor>
</Host>
</Hosts>
<Resources>
<bt:Images>
<bt:Image id="Group1LoginIcon16" DefaultValue="https://localhost:3000/assets/icon-16.png"/>
<bt:Image id="Group1LoginIcon32" DefaultValue="https://localhost:3000/assets/icon-32.png"/>
<bt:Image id="Group1LoginIcon80" DefaultValue="https://localhost:3000/assets/icon-64.png"/>
</bt:Images>
<bt:Urls>
<bt:Url id="Commands.Url" DefaultValue="https://localhost:3000/commands.html"/>
<bt:Url id="LoginTaskPaneUrl" DefaultValue="https://localhost:3000/taskpane.html"/>
</bt:Urls>
<bt:ShortStrings>
<bt:String id="ribbonNameLabel" DefaultValue="Add-in"/>
<bt:String id="AuthGroupNameLabel" DefaultValue="Auth"/>
<bt:String id="LoginButtonLabel" DefaultValue="Login" />
<bt:String id="LoginTaskPaneTitle" DefaultValue="Login" />
<bt:String id="LoginButtonToolTipTitle" DefaultValue="Tooltip Title" />
</bt:ShortStrings>
<bt:LongStrings>
<bt:String id="LoginButtonToolTipDescription" DefaultValue="Tooltip Description" />
</bt:LongStrings>
</Resources>
</VersionOverrides>
</OfficeApp>
Any help will be appreciated. Thanks
Upvotes: 0
Views: 243
Reputation: 49397
First of all, make sure that all icons are accessible by navigating to the URL specified in the manifest. If you don't see the icon then make it accessible.
Second, make sure no ribbon UI errors are shown in Excel. By default, if an add-in attempts to manipulate the Microsoft Office user interface (UI) and fails, no error message is displayed. However, you can configure Microsoft Office applications to display messages for errors that relate to the UI. You can use these messages to help determine why a custom ribbon does not appear, or why a ribbon appears but no controls appear.
File
tab.Options
.Advanced
.Show VSTO Add-in user interface errors
, and then click OK
.Third, try to Clear the Office cache if your new images are not displayed.
Upvotes: 1