我正在尝试为Outlook 2016创建一个加载项。在Office的早期版本中,这是使用WinForms UserControl完成的,相当简单。然而,现在有在Visual Studio 2015年通用模板的办公地址在,我想用,而不是展望VSTO添加在(均显示在这里)。
我的问题是,选择新的当办公室地址在模板时,Visual Studio然后询问哪些应用程序(一个或多个)这个插件是,如图所示,没有一个用于Outlook选项。
因此,我想知道如何使用新的Office模板为Outlook 2016创建自定义任务窗格?
对图片链接的道歉,我还没有足够的代表直接将其添加到问题中。谢谢!
GitHub上有一个示例解决方案。在此示例中,使用了JavaScript和HTML。这是一个JavaScript的示例,该JavaScript从选定的电子邮件中提取数据:
Office.initialize = function (reason) {
$(document).ready(function () {
app.initialize();
loadProps();
});
};
function loadProps() {
var item = Office.context.mailbox.item;
$('#dateTimeCreated').text(item.dateTimeCreated.toLocaleString());
$('#dateTimeModified').text(item.dateTimeModified.toLocaleString());
$('#itemClass').text(item.itemClass);
$('#itemId').text(item.itemId);
$('#itemType').text(item.itemType);
if (item.itemType == Office.MailboxEnums.ItemType.Message){
loadMessageProps(item);
}
else {
loadAppointmentProps(item);
}
}
然后将其链接到HTML页面以显示数据。为了将此添加到Outlook,还有一个XML清单文件。这告诉Outlook在哪里可以找到页面,这是该文件的一个片段:
<Requirements>
<bt:Sets DefaultMinVersion="1.3">
<bt:Set Name="Mailbox" />
</bt:Sets>
</Requirements>
<Hosts>
<Host xsi:type="MailHost">
<DesktopFormFactor>
<!-- Message read form -->
<ExtensionPoint xsi:type="MessageReadCommandSurface">
<OfficeTab id="TabDefault">
<Group id="msgReadDemoGroup">
<Label resid="groupLabel" />
<Tooltip resid="groupTooltip" />
<!-- Task pane button -->
<Control xsi:type="Button" id="msgReadOpenPaneButton">
<Label resid="paneReadButtonLabel" />
<Tooltip resid="paneReadButtonTooltip" />
<Supertip>
<Title resid="paneReadSuperTipTitle" />
<Description resid="paneReadSuperTipDescription" />
</Supertip>
<Icon>
<bt:Image size="16" resid="green-icon-16" />
<bt:Image size="32" resid="green-icon-32" />
<bt:Image size="80" resid="green-icon-80" />
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="readTaskPaneUrl" />
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
希望这对其他人有所帮助。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句