如何为我的Excel加载项设置功能区图标

时间:2018-03-21 22:08:57

标签: excel office-js office-addins

我为excel功能区的按钮设置了图标。但它仍然显示默认图像:

[[1, 1, 1, 1]]

我应该在哪里设置功能区的图像?

更新:我发现问题不是来自清单设置。如果我将Web项目配置从<ExtensionPoint xsi:type="PrimaryCommandSurface"> <!-- Use OfficeTab to extend an existing Tab. Use CustomTab to create a new tab. --> <OfficeTab id="TabHome"> <!-- Ensure you provide a unique id for the group. Recommendation for any IDs is to namespace using your company name. --> <Group id="Excely.SheetExplorer.Group"> <!-- Label for your group. resid must point to a ShortString resource. --> <Label resid="Excely.GroupLabel" /> <!-- Icons. Required sizes 16,32,80, optional 20, 24, 40, 48, 64. Strongly recommended to provide all sizes for great UX. --> <!-- Use PNG icons. All URLs on the resources section must use HTTPS. --> <Icon> <bt:Image size="16" resid="Excely.tpicon_16x16" /> <bt:Image size="32" resid="Excely.tpicon_32x32" /> <bt:Image size="80" resid="Excely.tpicon_80x80" /> </Icon> <!-- Control. It can be of type "Button" or "Menu". --> <Control xsi:type="Button" id="Excely.TaskpaneButton"> <Label resid="Excely.TaskpaneButton.Label" /> <Supertip> <!-- ToolTip title. resid must point to a ShortString resource. --> <Title resid="Excely.TaskpaneButton.Label" /> <!-- ToolTip description. resid must point to a LongString resource. --> <Description resid="Excely.TaskpaneButton.Tooltip" /> </Supertip> <Icon> <bt:Image size="16" resid="Excely.tpicon_16x16" /> <bt:Image size="32" resid="Excely.tpicon_32x32" /> <bt:Image size="80" resid="Excely.tpicon_80x80" /> </Icon> <!-- This is what happens when the command is triggered (E.g. click on the Ribbon). Supported actions are ExecuteFunction or ShowTaskpane. --> <Action xsi:type="ShowTaskpane"> <TaskpaneId>ShowMainMenu</TaskpaneId> <!-- Provide a URL resource id for the location that will be displayed on the task pane. --> <SourceLocation resid="Excely.Taskpane.Url" /> </Action> </Control> </Group> </OfficeTab> </ExtensionPoint> 更改为Local IIS,则图标工作正常。但是当它设置为IIS Express时,会出现默认图标!

1 个答案:

答案 0 :(得分:2)

您提供的清单部分仅显示您已创建的渣油名称。在清单的资源部分中,您无需显示,您需要使用图标文件的URL定义这些残值。

此外,除非清除Office缓存,否则对按钮图标的更改有时不会生效。请参阅Clear the Office Cache