【问题标题】:Publishing Outlook add-in which uses Outlook preview element - SupportsSharedFolders发布使用 Outlook 预览元素的 Outlook 加载项 - SupportsSharedFolders
【发布时间】:2019-04-02 09:27:32
【问题描述】:

我正在开发适用于共享邮箱的 Outlook 插件。 目前,Office 插件在委托方案中不可用,但 MS 已发布支持这些方案的预览版本。 https://docs.microsoft.com/en-us/office/dev/add-ins/reference/manifest/supportssharedfolders

我的问题是因为 manifest.xml 有预览元素;我无法在my add-ins 下的outlook.office365.com 上传它。我收到以下错误。

This app can't be installed. The manifest file doesn't conform to the schema definition. The element 'DesktopFormFactor' in namespace 'http://schemas.microsoft.com/office/mailappversionoverrides/1.1' has invalid child element 'SupportsSharedFolders' in namespace 'http://schemas.microsoft.com/office/mailappversionoverrides/1.1'. List of possible elements expected: 'ExtensionPoint' in namespace 'http://schemas.microsoft.com/office/mailappversionoverrides/1.1'... The element 'DesktopFormFactor' in namespace 'http://schemas.microsoft.com/office/mailappversionoverrides/1.1' has invalid child element 'SupportsSharedFolders' in namespace 'http://schemas.microsoft.com/office/mailappversionoverrides/1.1'. List of possible elements expected: 'ExtensionPoint' in namespace 'http://schemas.microsoft.com/office/mailappversionoverrides/1.1'.

任何人都知道任何其他方式来为用户部署外接程序,甚至在不上传 xml 文件的情况下对其进行测试?

提前致谢。

我的 manifest.xml 文件的副本在这里。

<?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"
          xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
          xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides"
          xsi:type="MailApp">

  <Version>1.0.0.0</Version>
  <ProviderName></ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue="Sample1" />
  <Description DefaultValue="First Sample Angular Add-in"/>
  <IconUrl DefaultValue="xxxx.jpg" />
  <HighResolutionIconUrl DefaultValue="https://localhost:3000/assets/hi-res-icon.png"/>

  <!--If you plan to submit this add-in to the Office Store, uncomment the SupportUrl element below-->
  <SupportUrl DefaultValue="https://localhost:3000/support.html" />

  <!-- Domains that will be allowed when navigating. For example, if you use ShowTaskpane and then have an href link, navigation will only be allowed if the domain is on this list. -->
  <AppDomains>
    <AppDomain>AppDomain1</AppDomain>
    <AppDomain>AppDomain2</AppDomain>
    <AppDomain>AppDomain3</AppDomain>
  </AppDomains>
  <!--End Basic Settings. -->

  <Hosts>
    <Host Name="Mailbox" />
  </Hosts>
  <Requirements>
    <Sets>
      <Set Name="Mailbox" MinVersion="1.1" />
    </Sets>
  </Requirements>
  <FormSettings>
    <Form xsi:type="ItemRead">
      <DesktopSettings>
        <SourceLocation DefaultValue="https://localhost:3000/index.html"/>
        <RequestedHeight>250</RequestedHeight>
      </DesktopSettings>
    </Form>
  </FormSettings>

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

  <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
    <Description resid="residDescription" />
    <Requirements>
      <bt:Sets DefaultMinVersion="1.3">
        <bt:Set Name="Mailbox" />
      </bt:Sets>
    </Requirements>
    <Hosts>
      <Host xsi:type="MailHost">
        <!-- add information on form factors -->
      </Host>
    </Hosts>
    <Resources>
      <!-- add information on resources -->
    </Resources>

    <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
    <Requirements>
      <bt:Sets DefaultMinVersion="1.3">
        <bt:Set Name="Mailbox" />
      </bt:Sets>
    </Requirements>
    <Hosts>
      <Host xsi:type="MailHost">

        <DesktopFormFactor>
          <!-- Location of the Functions that UI-less buttons can trigger (ExecuteFunction Actions). -->
          <FunctionFile resid="functionFile" />
          <SupportsSharedFolders>true</SupportsSharedFolders>
          <!-- Message Read -->
          <ExtensionPoint xsi:type="MessageReadCommandSurface">
            <!-- Use the default tab of the ExtensionPoint or create your own with <CustomTab id="myTab"> -->
            <OfficeTab id="TabDefault">
              <!-- Up to 6 Groups added per Tab -->
              <Group id="msgReadGroup">
                <Label resid="groupLabel" />
                <!-- Launch the add-in : task pane button -->
                <Control xsi:type="Button" id="msgReadOpenPaneButton">
                  <Label resid="paneReadButtonLabel" />
                  <Supertip>
                    <Title resid="paneReadSuperTipTitle" />
                    <Description resid="paneReadSuperTipDescription" />
                  </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="messageReadTaskPaneUrl" />
                  </Action>
                </Control>
                <!-- Go to http://aka.ms/ButtonCommands to learn how to add more Controls: ExecuteFunction and Menu -->
              </Group>
            </OfficeTab>
          </ExtensionPoint>
          <!-- Go to http://aka.ms/ExtensionPointsCommands to learn how to add more Extension Points: MessageRead, AppointmentOrganizer, AppointmentAttendee -->
        </DesktopFormFactor>
      </Host>
    </Hosts>
    <Resources>
      <!-- add information on resources -->
    </Resources>
    </VersionOverrides>
  </VersionOverrides>
</OfficeApp>

【问题讨论】:

    标签: outlook-addin office-addins yeoman-generator outlook-web-addins


    【解决方案1】:

    解释@Bubuhubu 的答案,并希望帮助其他遇到此问题的人。

    如果您使用 yo 生成器最初创建清单,如以下 Microsoft 如何文章中所述: https://docs.microsoft.com/en-us/outlook/add-ins/addin-tutorial

    您会注意到&lt;VersionOverrides&gt; 标记是在没有版本号的情况下创建的。此版本的 VersionOverrides 元素不支持 &lt;SupportsSharedFolders&gt; 标记,但 1.1 版本支持。

    您可能认为只需将 VersionOverrides 标记的 xmlns 和 type 标记更改为 1.1 即可获得该标记的支持,但显然 OfficeApp 标记中不支持 1.1 VersionOverrides 标记。但是,它支持作为 VersionOverrides 1.0 标记的子元素。

    因此,解决此问题的最简单方法是从 yo generatort 中获取 manifest.xml 并找到:

    <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
    

    然后添加:

    <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
    

    所以它现在看起来像这样:

      <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
        <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
    

    同样,在文档末尾附近,找到:

    </VersionOverrides>
    

    并将其更改为:

        </VersionOverrides>
      </VersionOverrides>
    

    您现在可以使用&lt;SupportsSharedFolders&gt;,例如您的 manifest.xml 应如下所示:

    . . .
    <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
        <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
          <Requirements>
            <bt:Sets DefaultMinVersion="1.3">
              <bt:Set Name="Mailbox" />
            </bt:Sets>
          </Requirements>
          <Hosts>
            <Host xsi:type="MailHost">
    
              <DesktopFormFactor>
                <SupportsSharedFolders>true</SupportsSharedFolders>
    . . .
    
      </VersionOverrides>
      </VersionOverrides>
    </OfficeApp>
    

    希望这有助于节省一些时间。

    顺便说一句,显然,当您在 Outlook 中添加插件时,它最多可能需要 60 秒才能显示出来。因此,如果您没有立即看到您的图标,请不要一开始就认为它不起作用(就像我最初所做的那样)。

    【讨论】:

      【解决方案2】:

      我今天遇到了同样的问题。我能够通过移动来解决它 SupportsSharedFolders 标记到DesktopFormFactor 标记的开头。

      而不是这个:

      ...
      <DesktopFormFactor>
        <!-- Location of the Functions that UI-less buttons can trigger (ExecuteFunction Actions). -->
        <FunctionFile resid="functionFile" />
        <SupportsSharedFolders>true</SupportsSharedFolders>
        <!-- Message Read -->
        ...
      

      应该是这样的

      ...
      <DesktopFormFactor>
        <SupportsSharedFolders>true</SupportsSharedFolders>
        <!-- Location of the Functions that UI-less buttons can trigger (ExecuteFunction Actions). -->
        <FunctionFile resid="functionFile" />
        <!-- Message Read -->
        ...
      

      【讨论】:

      • 这对我不起作用。你能在哪里成功加载这个?
      【解决方案3】:

      这是对我有用的示例清单文件。

      <?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"
                xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
                xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides"
                xsi:type="MailApp">
      
        <!-- Begin Basic Settings: Add-in metadata, used for all versions of Office unless override provided. -->
      
        <!-- IMPORTANT! Id must be unique for your add-in, if you reuse this manifest ensure that you change this id to a new GUID. -->
        <Id>XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX</Id>
      
        <!--Version. Updates from the store only get triggered if there is a version change. -->
        <Version>1.0.0.0</Version>
        <ProviderName></ProviderName>
        <DefaultLocale>en-US</DefaultLocale>
        <!-- The display name of your add-in. Used on the store and various places of the Office UI such as the add-ins dialog. -->
        <DisplayName DefaultValue="" />
        <Description DefaultValue=""/>
      
        <!-- Icon for your add-in. Used on installation screens and the add-ins dialog. -->
        <IconUrl DefaultValue="" />
        <HighResolutionIconUrl DefaultValue="https://localhost:3000/assets/hi-res-icon.png"/>
      
        <!--If you plan to submit this add-in to the Office Store, uncomment the SupportUrl element below-->
        <SupportUrl DefaultValue="https://localhost:3000/support.html" />
      
        <!-- Domains that will be allowed when navigating. For example, if you use ShowTaskpane and then have an href link, navigation will only be allowed if the domain is on this list. -->
        <AppDomains>
          <AppDomain>AppDomain1</AppDomain>
          <AppDomain>AppDomain2</AppDomain>
          <AppDomain>AppDomain3</AppDomain>
        </AppDomains>
        <!--End Basic Settings. -->
      
        <Hosts>
          <Host Name="Mailbox" />
        </Hosts>
        <Requirements>
          <Sets>
            <Set Name="Mailbox" MinVersion="1.1" />
          </Sets>
        </Requirements>
        <FormSettings>
          <Form xsi:type="ItemRead">
            <DesktopSettings>
              <SourceLocation DefaultValue="https://localhost:3000/index.html"/>
              <RequestedHeight>250</RequestedHeight>
            </DesktopSettings>
          </Form>
        </FormSettings>
      
        <Permissions>ReadWriteItem</Permissions>
        <Rule xsi:type="RuleCollection" Mode="Or">
          <Rule xsi:type="ItemIs" ItemType="Message" FormType="Read" />
        </Rule>
        <DisableEntityHighlighting>false</DisableEntityHighlighting>
      
        <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
          <Requirements>
            <bt:Sets DefaultMinVersion="1.3">
              <bt:Set Name="Mailbox" />
            </bt:Sets>
          </Requirements>
          <Hosts>
            <Host xsi:type="MailHost">
      
              <DesktopFormFactor>
                <!-- Location of the Functions that UI-less buttons can trigger (ExecuteFunction Actions). -->
                <FunctionFile resid="functionFile" />
                <!-- Message Read -->
                <ExtensionPoint xsi:type="MessageReadCommandSurface">
                  <!-- Use the default tab of the ExtensionPoint or create your own with <CustomTab id="myTab"> -->
                  <OfficeTab id="TabDefault">
                    <!-- Up to 6 Groups added per Tab -->
                    <Group id="msgReadGroup">
                      <Label resid="groupLabel" />
                      <!-- Launch the add-in : task pane button -->
                      <Control xsi:type="Button" id="msgReadOpenPaneButton">
                        <Label resid="paneReadButtonLabel" />
                        <Supertip>
                          <Title resid="paneReadSuperTipTitle" />
                          <Description resid="paneReadSuperTipDescription" />
                        </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="messageReadTaskPaneUrl" />
                        </Action>
                      </Control>
                      <!-- Go to http://aka.ms/ButtonCommands to learn how to add more Controls: ExecuteFunction and Menu -->
                    </Group>
                  </OfficeTab>
                </ExtensionPoint>
                <!-- Go to http://aka.ms/ExtensionPointsCommands to learn how to add more Extension Points: MessageRead, AppointmentOrganizer, AppointmentAttendee -->
              </DesktopFormFactor>
            </Host>
          </Hosts>
      
          <Resources>
            <bt:Images>
              <bt:Image id="icon16" DefaultValue="https://localhost:3000/assets/XXXX-16.png"/>
              <bt:Image id="icon32" DefaultValue="https://localhost:3000/assets/XXXX-32.png"/>
              <bt:Image id="icon80" DefaultValue="https://localhost:3000/assets/XXXX-80.png"/>
            </bt:Images>
            <bt:Urls>
              <bt:Url id="functionFile" DefaultValue="https://localhost:3000/function-file/function-file.html"/>
              <bt:Url id="messageReadTaskPaneUrl" DefaultValue="https://localhost:3000/index.html"/>
            </bt:Urls>
            <bt:ShortStrings>
              <bt:String id="groupLabel" DefaultValue="My Add-in Group"/>
              <bt:String id="customTabLabel"  DefaultValue="My Add-in Tab"/>
              <bt:String id="paneReadButtonLabel" DefaultValue="Display all properties"/>
              <bt:String id="paneReadSuperTipTitle" DefaultValue="Get all properties"/>
            </bt:ShortStrings>
            <bt:LongStrings>
              <bt:String id="paneReadSuperTipDescription" DefaultValue="Opens a pane displaying all available properties. This is an example of a button that opens a task pane."/>
            </bt:LongStrings>
          </Resources>
        <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
          <Requirements>
            <bt:Sets DefaultMinVersion="1.3">
              <bt:Set Name="Mailbox" />
            </bt:Sets>
          </Requirements>
          <Hosts>
            <Host xsi:type="MailHost">
      
              <DesktopFormFactor>
                  <SupportsSharedFolders>true</SupportsSharedFolders>
                <!-- Location of the Functions that UI-less buttons can trigger (ExecuteFunction Actions). -->
                <FunctionFile resid="functionFile" />
                <!-- Message Read -->
                <ExtensionPoint xsi:type="MessageReadCommandSurface">
                  <!-- Use the default tab of the ExtensionPoint or create your own with <CustomTab id="myTab"> -->
                  <OfficeTab id="TabDefault">
                    <!-- Up to 6 Groups added per Tab -->
                    <Group id="msgReadGroup">
                      <Label resid="groupLabel" />
                      <!-- Launch the add-in : task pane button -->
                      <Control xsi:type="Button" id="msgReadOpenPaneButton">
                        <Label resid="paneReadButtonLabel" />
                        <Supertip>
                          <Title resid="paneReadSuperTipTitle" />
                          <Description resid="paneReadSuperTipDescription" />
                        </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="messageReadTaskPaneUrl" />
                        </Action>
                      </Control>
                      <!-- Go to http://aka.ms/ButtonCommands to learn how to add more Controls: ExecuteFunction and Menu -->
                    </Group>
                  </OfficeTab>
                </ExtensionPoint>
                <!-- Go to http://aka.ms/ExtensionPointsCommands to learn how to add more Extension Points: MessageRead, AppointmentOrganizer, AppointmentAttendee -->
              </DesktopFormFactor>
            </Host>
          </Hosts>
      
          <Resources>
            <bt:Images>
              <bt:Image id="icon16" DefaultValue="https://localhost:3000/assets/XXXX-16.png"/>
              <bt:Image id="icon32" DefaultValue="https://localhost:3000/assets/XXXXX-32.png"/>
              <bt:Image id="icon80" DefaultValue="https://localhost:3000/assets/XXXX-80.png"/>
            </bt:Images>
            <bt:Urls>
              <bt:Url id="functionFile" DefaultValue="https://localhost:3000/function-file/function-file.html"/>
              <bt:Url id="messageReadTaskPaneUrl" DefaultValue="https://localhost:3000/index.html"/>
            </bt:Urls>
            <bt:ShortStrings>
              <bt:String id="groupLabel" DefaultValue="My Add-in Group"/>
              <bt:String id="customTabLabel"  DefaultValue="My Add-in Tab"/>
              <bt:String id="paneReadButtonLabel" DefaultValue="Display all properties"/>
              <bt:String id="paneReadSuperTipTitle" DefaultValue="Get all properties"/>
            </bt:ShortStrings>
            <bt:LongStrings>
              <bt:String id="paneReadSuperTipDescription" DefaultValue="Opens a pane displaying all available properties. This is an example of a button that opens a task pane."/>
            </bt:LongStrings>
          </Resources>
        </VersionOverrides>
        </VersionOverrides>
      </OfficeApp>
      
      

      【讨论】:

      • 谢谢!我可以确认这也对我有用。我将进行比较并找出具体的不同之处。
      猜你喜欢
      • 2021-12-11
      • 1970-01-01
      • 1970-01-01
      • 2023-03-17
      • 2020-04-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多