【发布时间】:2019-03-23 06:48:44
【问题描述】:
我正在使用 VSTO 开发一个 Outlook 插件。
在方法中: this.Load += new Microsoft.Office.Tools.Ribbon.RibbonUIEventHandler(this.MyApp_Load);
在我的 Ribbon 的 MyApp_Load 中,我使用以下代码:
if (Globals.ThisAddIn.isLoggedIn())
{
btnMyApp.Visible= true;
Outlook.Inspector inspector =
Globals.ThisAddIn.Application.ActiveInspector();
if (inspector != null && inspector.CurrentItem != null)
{
当我在 Outlook 中打开 AppointmentItem 时,我可以调试上面的代码。不幸的是,ActiveInspector() == null 尽管正在显示有效的 AppointmentItem。
为什么?
【问题讨论】:
-
我在 Stackoverflow 中找到了这个解决方案。 stackoverflow.com/questions/18458338/…
标签: vsto outlook-addin