是否可以在 Outlook 365 中保持任务窗格加载项打开?

Is it possible to keep a taskpane add-in open in Outlook 365?

我的任务是开发一个在阅读电子邮件时 'always open' 的 Outlook 加载项。

插件的要求是:

想法是用户有一个 TaskPane 或固定面板,它在阅读电子邮件时可见。上下文始终是要由加载项处理或转发的活动电子邮件。

我花了很多时间尝试使“SupportsPinning”工作,但没有成功。根据文档,此功能仅适用于 Outlook 2016。

我偶然发现了 TaskPaneApp,它显然应该是 'always open'? 但它的支持似乎有限?

我在 Github 上找到了 TaskPane 示例,但在 Outlook 中它声明插件是一个带有 TaskPane 的 MailApp,而不是一个 TaskPaneApp。这是因为 Outlook 不支持 TaskPaneApp 的吗?

清单如下:

<?xml version="1.0" encoding="UTF-8"?>
<!--Created:ce44715c-8c4e-446b-879c-ea9ebe0f09c8-->
<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>77ad5285-3a98-4387-a4b3-c70c6e12cd6a</Id>
<!--Version. Updates from the store only get triggered if there is a version change. -->
<Version>1.0.0.0</Version>
<ProviderName>AutoIT A/S</ProviderName>
<DefaultLocale>da-dk</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="AutoDesktop CRM Outlook Add-in" />
<Description DefaultValue="AutoIT CRM Add-in for added integration with AutoDesktop"/>
<IconUrl DefaultValue="https://localhost:44329/Images/icon64.png"/>

<SupportUrl DefaultValue="https://www.autoit.dk/support" />

<!-- 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>autodesktop.dk</AppDomain>
    <AppDomain>autoit.dk</AppDomain>
</AppDomains>

<!--End Basic Settings. -->
<Hosts>
    <Host Name="Mailbox" />
</Hosts>

<Requirements>
    <Sets>
        <Set Name="Mailbox" MinVersion="1.5" />
    </Sets>
</Requirements>

<FormSettings>
    <Form xsi:type="ItemRead">
        <DesktopSettings>
            <SourceLocation DefaultValue="https://localhost:44329/MessageRead.html"/>
            <RequestedHeight>250</RequestedHeight>
        </DesktopSettings>
    </Form>
</FormSettings>

<Permissions>ReadWriteMailbox</Permissions>

<!-- Activationg rules. (Specify WHEN the ADDIN is activated) -->
<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="residAppDescription" />-->
        
    <Requirements>
        <bt:Sets DefaultMinVersion="1.5">
            <bt:Set Name="Mailbox" />
        </bt:Sets>
    </Requirements>
    
    <Hosts>
        <Host xsi:type="MailHost">

            <!-- Definition of the ADDIN Ribbon buttons-->
            <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>

                            <Control xsi:type="Button" id="testMsgReadOpenPaneButton">
                                <Label resid="testPaneReadButtonLabel" />
                                <Supertip>
                                    <Title resid="testPaneReadSuperTipTitle" />
                                    <Description resid="testPaneReadSuperTipDescription" />
                                </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="testMRWebServiceCalls" />
                                </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:44329/Images/icon16.png"/>
            <bt:Image id="icon32" DefaultValue="https://localhost:44329/Images/icon32.png"/>
            <bt:Image id="icon80" DefaultValue="https://localhost:44329/Images/icon80.png"/>
        </bt:Images>
        <bt:Urls>
            <bt:Url id="functionFile" DefaultValue="https://localhost:44329/Functions/FunctionFile.html"/>
            <bt:Url id="messageReadTaskPaneUrl" DefaultValue="https://localhost:44329/MessageRead.html"/>
            <bt:Url id="testMRWebServiceCalls" DefaultValue="https://localhost:44329/testMessageReadWebServiceCalls.html"/>
        </bt:Urls>
        <bt:ShortStrings>
            <bt:String id="groupLabel" DefaultValue="ADT's Super-Duber 'Not-an-Easi'r-clone' Add-in"/>
            <bt:String id="customTabLabel"  DefaultValue="My Add-in Tab"/>

            <bt:String id="paneReadButtonLabel" DefaultValue="ADT - Display all email properties"/>
            <bt:String id="paneReadSuperTipTitle" DefaultValue="ADT - Gets all the email properties"/>

            <bt:String id="testPaneReadButtonLabel" DefaultValue="TEST - Other button"/>
            <bt:String id="testPaneReadSuperTipTitle" DefaultValue="TEST - This button will do some stuff aswell"/>
        </bt:ShortStrings>
        <bt:LongStrings>
            <bt:String id="paneReadSuperTipDescription" DefaultValue="ADT - Opens a pane displaying all available properties. This is an example of a button that opens a task pane."/>
            <bt:String id="testPaneReadSuperTipDescription" DefaultValue="TEST - Does some stuff. Hopefully it works. Might delete later"/>
        </bt:LongStrings>
    </Resources>


    <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" 
                      xsi:type="VersionOverridesV1_1">
        
        <!--<Description resid="residDescription" />-->
        <Requirements>
            <!-- add information on requirements -->
            <bt:Sets DefaultMinVersion="1.5"><!-- <<<<  -->
                <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>

                                <Control xsi:type="Button" id="testMsgReadOpenPaneButton">
                                    <Label resid="testPaneReadButtonLabel" />
                                    <Supertip>
                                        <Title resid="testPaneReadSuperTipTitle" />
                                        <Description resid="testPaneReadSuperTipDescription" />
                                    </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="testMRWebServiceCalls" />
                                        <SupportsPinning>true</SupportsPinning>
                                    </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>
            
            <Host xsi:type="MailHost">
                <MobileFormFactor>
                    <FunctionFile resid="functionFile" />
                    <ExtensionPoint xsi:type="MobileMessageReadCommandSurface">
                        <Group id="mobileMsgRead">
                            <Label resid="groupLabel" />
                            <Control xsi:type="MobileButton" id="msgReadOpenPaneButton">
                                <Label resid="paneReadButtonLabel" />
                                <Icon xsi:type="bt:MobileIconList">
                                    <bt:Image size="25" scale="1" resid="mIcon25" />
                                    <bt:Image size="25" scale="2" resid="mIcon25" />
                                    <bt:Image size="25" scale="3" resid="mIcon25" />

                                    <bt:Image size="32" scale="1" resid="mIcon32" />
                                    <bt:Image size="32" scale="2" resid="mIcon32" />
                                    <bt:Image size="32" scale="3" resid="mIcon32" />

                                    <bt:Image size="48" scale="1" resid="mIcon48" />
                                    <bt:Image size="48" scale="2" resid="mIcon48" />
                                    <bt:Image size="48" scale="3" resid="mIcon48" />
                                </Icon>
                                
                                <Action xsi:type="ShowTaskpane">
                                    <SourceLocation resid="mobileMessageReadTaskPaneUrl"/>
                                </Action>
                            </Control>
                        </Group>
                    </ExtensionPoint>
                </MobileFormFactor>
            </Host>
        </Hosts>
        
        <Resources>
            <bt:Images>
                <bt:Image id="icon16" DefaultValue="https://localhost:44329/Images/icon16.png"/>
                <bt:Image id="icon32" DefaultValue="https://localhost:44329/Images/icon32.png"/>
                <bt:Image id="icon80" DefaultValue="https://localhost:44329/Images/icon80.png"/>
                <bt:Image id="mIcon25" DefaultValue="https://localhost:44329/Images/Icon-25.png"/>
                <bt:Image id="mIcon32" DefaultValue="https://localhost:44329/Images/Icon-32.png"/>
                <bt:Image id="mIcon48" DefaultValue="https://localhost:44329/Images/Icon-48.png"/>
            </bt:Images>
            <bt:Urls>
                <bt:Url id="functionFile" DefaultValue="https://localhost:44329/Functions/FunctionFile.html"/>
                <bt:Url id="messageReadTaskPaneUrl" DefaultValue="https://localhost:44329/MessageRead.html"/>
                <bt:Url id="mobileMessageReadTaskPaneUrl" DefaultValue="https://localhost:44329/MessageRead.html"/>
                <bt:Url id="testMRWebServiceCalls" DefaultValue="https://localhost:44329/testMessageReadWebServiceCalls.html"/>
            </bt:Urls>
            <bt:ShortStrings>
                <bt:String id="groupLabel" DefaultValue="ADT's Super-Duber Add-in"/>
                <bt:String id="customTabLabel"  DefaultValue="My Add-in Tab"/>

                <bt:String id="paneReadButtonLabel" DefaultValue="Display all email properties"/>
                <bt:String id="paneReadSuperTipTitle" DefaultValue="Gets all the email properties"/>

                <bt:String id="testPaneReadButtonLabel" DefaultValue="Other button"/>
                <bt:String id="testPaneReadSuperTipTitle" DefaultValue="This button will do some stuff aswell"/>
            </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:String id="testPaneReadSuperTipDescription" DefaultValue="Does some stuff. Hopefully it works. Might delete later"/>
            </bt:LongStrings>
        </Resources>
    
    </VersionOverrides>

</VersionOverrides>

在调查启用了 SupportsPinning 的加载项的 Yeomen 生成代码时,我注意到它在清单中没有 MobileFormFactor。

从我的清单中删除此条目导致固定功能显示并按预期工作!