編輯

共用方式為


IconUrl element

Specifies the full, absolute URL of the image that is used to represent your Office Add-in in the insertion UX, AppSource, and the vertical task pane tab bar.

Add-in type: Content, Task pane, Mail

Syntax

<IconUrl DefaultValue="string" />

Can contain

Attributes

Attribute Type Required Description
DefaultValue string Yes Specifies the default value for this setting, expressed for the locale specified in the DefaultLocale element.

Remarks

The image must be in one of the following file formats.

  • BMP
  • EXIF
  • GIF
  • JPG
  • PNG
  • TIFF

The image resolution requirements are as follows.

Add-in type Resolution (pixels)
Content 32 x 32
Mail 64 x 64
Task pane 32 x 32

You should also specify an icon for use with Office client applications running on high DPI screens using the HighResolutionIconUrl element. For more information, see the section Create a consistent visual identity in Create effective listings in AppSource and within Office.

For a mail add-in, the icon is displayed in the File > Manage add-ins UI (Outlook) or Settings > Manage add-ins UI (Outlook on the web). For a content or task pane add-in, the icon is displayed in the Insert > Add-ins UI.

The image is also used on the vertical tab bar for the task pane when more than one task pane is open. The tab bar appears beside the task pane whenever a second task pane is opened, regardless of whether it is a task pane in the same add-in or a different add-in. The following image shows the tab bar when the Script Lab add-in and another add-in have both been started and both the Code and Run task panes of Script Lab have been opened.

The top inch of a task pane, with three square tabs to the right of the upper right corner. Two of the tabs have the Script Lab icon. The third has an icon for a different add-in.

For all add-in types, the icon is also used in AppSource, if you publish your add-in to AppSource.

Changing the value of the IconUrl element at runtime is not currently supported.

Examples

<IconUrl DefaultValue="https://localhost:3000/assets/images/icon-32.png" />
<IconUrl DefaultValue="https://script-lab.azureedge.net/assets/images/icon-32.png" />