首页 文章

Outlook加载项功能区按钮未显示

提问于
浏览
1

背景

我'm developing an Office addin for Outlook. I'm试图在应该打开TaskPane的功能区上添加一个按钮 . 我在清单中的 <Control> 块下定义了功能区按钮:

<?xml version="1.0" encoding="UTF-8"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="MailApp">

  <Id>1bf213f9-65a5-4395-aef8-239d72c7e509</Id>
  <Version>1.0.0.0</Version>
  <ProviderName>myProviderName</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue="myDisplayName" />
  <Description DefaultValue="myDescription"/>
  <Hosts>
    <Host Name="Mailbox" />
  </Hosts>
  <Requirements>
    <Sets>
      <Set Name="MailBox" MinVersion="1.1" />
    </Sets>
  </Requirements>
  <FormSettings>
    <Form xsi:type="ItemEdit">
      <DesktopSettings>
        <SourceLocation DefaultValue="https://hiddenurl/app/index.html" />
      </DesktopSettings>
    </Form>
  </FormSettings>

  <Permissions>ReadWriteItem</Permissions>

  <Rule xsi:type="RuleCollection" Mode="Or">
    <Rule xsi:type="ItemIs" FormType="Edit" ItemType="Message"/>
  </Rule>
  <DisableEntityHighlighting>false</DisableEntityHighlighting>

  <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides"
                    xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
                    xsi:type="VersionOverridesV1_0">
    <Hosts>
      <Host xsi:type="MailHost">
        <DesktopFormFactor>
          <ExtensionPoint xsi:type="MessageComposeCommandSurface">
            <OfficeTab id="TabDefault">
              <Group id="mainGroup">
                <Label resid="groupLabel"/>
                <Tooltip resid="groupsTooltip"/>

                <Control xsi:type="Button" id="button">
                  <Label resid="buttonLabel"/>
                  <Tooltip resid="buttonTooltip"/>
                  <Supertip>
                    <Title resid="superTipTitle"/>
                    <Description resid="superTipDescription"/>
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="icon16"/>
                    <bt:Image size="32" resid="icon32"/>
                    <bt:Image size="80" resid="icon80"/>
                  </Icon>
                  <Action xsi:type="ShowTaskpane">
                    <SourceLocation resid="taskPaneUrl" />
                  </Action>
                </Control>
              </Group>
            </OfficeTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>
    </Hosts>
    <Resources> 
      <bt:Images>
        <bt:Image id="icon16" DefaultValue="https://hiddenurl/assets/icons/icon_16.png" />
        <bt:Image id="icon32" DefaultValue="https://hiddenurl/assets/icons/icon_32.png" />
        <bt:Image id="icon80" DefaultValue="https://hiddenurl/assets/icons/icon_80.png" />
      </bt:Images>
      <bt:Urls>
        <bt:Url id="taskPaneUrl" DefaultValue="https://hiddenurl/app/index.html" />
      </bt:Urls>
      <bt:ShortStrings>
        <bt:String id="tabLabel" DefaultValue="tabLabel" />
        <bt:String id="groupLabel" DefaultValue="groupLabel" />
        <bt:String id="groupsTooltip" DefaultValue="groupsTooltip" />
        <bt:String id="buttonLabel" DefaultValue="buttonLabel" />
        <bt:String id="buttonTooltip" DefaultValue="buttonTooltip" />
        <bt:String id="superTipTitle" DefaultValue="superTipTitle" />
        <bt:String id="superTipDescription" DefaultValue="superTipDescription" />
      </bt:ShortStrings>
   </Resources>
  </VersionOverrides>
</OfficeApp>

我希望在功能区上看到一个带有我的徽标的按钮,我应该可以点击它打开一个TaskPane . 但是,我看不到任何按钮,在Office加载项/我的加载项下,我的Addin甚至没有显示 .

我尝试了什么

如果我删除清单中的整个 <VersionOverrides> 块,则加载项会再次出现在Office加载项/我的加载项下,我可以通过那里访问我的TaskPane .

我试图按照这些例子取得成功:

问题

  • 我的清单文件有什么问题?

  • 如何验证清单文件是否声明功能区按钮正确?

  • 如何验证我的清单文件是否正确?

1 回答

  • 2

    您的资源部分格式不正确 . 请更新到以下内容,一切都将按照您的要求运行...

    <Resources> 
      <bt:Images>
        <bt:Image id="icon16" DefaultValue="https://hiddenurl/assets/icons/icon_16.png" />
        <bt:Image id="icon32" DefaultValue="https://hiddenurl/assets/icons/icon_16.png" />
        <bt:Image id="icon80" DefaultValue="https://hiddenurl/assets/icons/icon_16.png" />
      </bt:Images>
      <bt:Urls>
        <bt:Url id="taskPaneUrl" DefaultValue="https://hiddenurl/app/index.html" />
      </bt:Urls>
      <bt:ShortStrings>
        <bt:String id="tabLabel" DefaultValue="tabLabel" />
        <bt:String id="groupLabel" DefaultValue="groupLabel" />
        <bt:String id="buttonLabel" DefaultValue="buttonLabel" />
        <bt:String id="superTipTitle" DefaultValue="superTipTitle" />
      </bt:ShortStrings>
      <bt:LongStrings>
        <bt:String id="buttonTooltip" DefaultValue="buttonTooltip" />
        <bt:String id="groupsTooltip" DefaultValue="groupsTooltip" />
        <bt:String id="superTipDescription" DefaultValue="superTipDescription" />
      </bt:LongStrings>
    </Resources>
    

    您应该将“IconUrl”和“HighResolutionIconUrl”添加到“OfficeApp”部分,以支持对“VersionOverridesV1_0”一无所知的客户端 . 这两个节点应该在“描述”之后 . 如果您将来将应用程序提交到Office Store,则需要在“HighResolutionIconUrl”之后添加“SupportUrl”节点 .

    请记住清单文件中的所有内容都是严格的方案,应该是有效的 .

相关问题