Office.Conext.mailbox.displayNewMessageForm在移动设备中不工作

我试图在Outlook Web Add-in中单击按钮来创建新的邮件表单,但我使用了displayNewMessageForm。该功能在Web浏览器和Outlook桌面上运行良好。但同样的功能在Outlook Mobile中不起作用。

你们的Outlook手机有这个功能吗?

移动端清单:

 <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
      <Requirements>
        <bt:Sets DefaultMinVersion="1.5">
          <bt:Set Name="Mailbox" />
        </bt:Sets>
      </Requirements>
      <Hosts>
        <Host xsi:type="MailHost">
          <DesktopFormFactor>
            <FunctionFile resid="functionFile" />
            <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>

          <MobileFormFactor>
            <FunctionFile resid="functionFile" />
            <ExtensionPoint xsi:type="MobileMessageReadCommandSurface">
              <Group id="mobileMsgRead">
                <Label resid="groupLabel" />
                <Control xsi:type="MobileButton" id="TaskPaneBtn">
                  <Label resid="residTaskPaneButtonName" />
                  <Icon xsi:type="bt:MobileIconList">
                    <bt:Image size="25" scale="1" resid="icon32" />
                    <bt:Image size="25" scale="2" resid="icon32" />
                    <bt:Image size="25" scale="3" resid="icon32" />

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

                    <bt:Image size="48" scale="1" resid="icon32" />
                    <bt:Image size="48" scale="2" resid="icon32" />
                    <bt:Image size="48" scale="3" resid="icon32" />
                  </Icon>
                  <Action xsi:type="ShowTaskpane">
                    <SourceLocation resid="residTaskpaneUrl" />
                  </Action>
                </Control>
              </Group>
            </ExtensionPoint>
          </MobileFormFactor>
        </Host>
      </Hosts>
      <Resources>
        <bt:Images>
          <bt:Image id="icon16" DefaultValue="~remoteAppUrl/Images/icon16.png"/>

          <bt:Image id="icon32" DefaultValue="~remoteAppUrl/Images/icon32.png"/>

          <bt:Image id="icon80" DefaultValue="~remoteAppUrl/Images/icon80.png"/>

        </bt:Images>
        <bt:Urls>
          <bt:Url id="functionFile" DefaultValue="~remoteAppUrl/Functions/FunctionFile.html"/>
          <!--<bt:Url id="functionFile" DefaultValue="~remoteAppUrl/Functions/FunctionFile.html"/>-->
          <bt:Url id="messageReadTaskPaneUrl" DefaultValue="~remoteAppUrl/home.html"/>
          <bt:Url id="residTaskpaneUrl" DefaultValue="~remoteAppUrl/home.html"/>
          <!--<bt:Url id="messageReadTaskPaneUrl" DefaultValue="~remoteAppUrl/home.html"/>-->
        </bt:Urls>
        <bt:ShortStrings>
          <bt:String id="groupLabel" DefaultValue="test codeColumn"/>
          <bt:String id="customTabLabel" DefaultValue="test codeColumn"/>
          <bt:String id="paneReadButtonLabel" DefaultValue="test codeColumn"/>
          <bt:String id="residTaskPaneButtonName" DefaultValue="test codeColumn"/>
          <bt:String id="paneReadSuperTipTitle" DefaultValue="test codeColumn"> </bt:String>
        </bt:ShortStrings>
        <bt:LongStrings>
          <bt:String id="paneReadSuperTipDescription" DefaultValue="test test test">

          </bt:String>
        </bt:LongStrings>
      </Resources>
    </VersionOverrides>

更新:如果您只想在移动设备上使用它,请使用以下代码

Office.context.ui.displayDialogAsync(url,
    { height: 75, width: 80, requireHTTPS: true });

其中URL变量可以是这样的

var url = "mailto:someone@example.com?Subject=Hello%20again";

解决方案

displayNewAppointmentForm(在标题中)和displayNewMessageForm(在问题中)是两个不同的功能。Outlook for iOS或Outlook for Android不支持displayNewAppointmentForm函数。同时,当您在清单文件中正确指定对移动设备的支持时,displayNewMessageForm函数将在移动设备上工作。有关详细信息,请阅读Add support for add-in commands for Outlook Mobile文章。

相关文章