javascript - Office.context.mailbox.displayNewMessageForm 在移动设备中不起作用
问题描述
我试图通过单击 Outlook Web 插件中的按钮创建一个新的邮件表单,我使用displayNewMessageForm。该功能在 Web 浏览器和 Outlook 桌面上运行良好。但是相同的功能在 Outlook 移动版中不起作用。
你们的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
(在您的问题中)是两个不同的功能。displayNewAppointmentForm
Outlook for iOS 或 Outlook for Android 不支持该功能。同时displayNewMessageForm
,当您在清单文件中正确指定对移动设备的支持时,该功能将在移动设备上运行。有关详细信息,请阅读添加对 Outlook Mobile 加载项命令的支持一文。
推荐阅读
- c# - Newtonsoft.Json.Jobject.parse:未终止的字符串。预期的分隔符位置 32767
- jquery - 具有匹配字符串的 jQuery 选择属性
- python - urdu 字符串看起来相同,但相比之下发现不相等的 python3
- python - 从 JSON 获取服务器 ID
- java - 防止过多的注册请求
- android - 我的应用程序自动启动和关闭
- c# - C# XML 反序列化不返回列表类型的元素
- ruby-on-rails - Rails5:如何从 API 数据格式化货币值
- javascript - 函数式编程函数节奏
- python - 沿特定维度从 ndarray 中减去矩阵而不重塑