【问题标题】:how to check whether compose mail popup(Window)open or not in outlook using c# [closed]如何使用c#在Outlook中检查撰写邮件弹出(窗口)是否打开[关闭]
【发布时间】:2013-11-09 22:52:39
【问题描述】:

有人知道如何使用c#检查outlook new(Compose)邮件窗口(popup)是否打开吗?

注意:我使用的是 Outlook 2010。

【问题讨论】:

  • 作为经典,到目前为止有什么努力吗?
  • 是的,Soner.usinginspector.newinspector.but 我不会使用它,因为在 Outlook 事件之后提出了这个问题。为什么是负面标记?
  • @gustavohenke、Alexis Pigeon、Christoph、Mena、Spontifixus.i 得到了答案...

标签: c# outlook outlook-addin outlook-2010


【解决方案1】:

我不知道我是否理解您的问题,但您可以尝试以下方法:

//Check if the active inspector is a MailItem.
if(App.ActiveInspector().CurrentItem is OutlookApi.MailItem){
  //do something.
}

或者你可以使用事件ItemLoad

private void OnItemLoad(OutlookApi.COMObject item){
{
  if (item is OutlookApi.MailItem){
    //do something
  }
}

希望对你有帮助。

问候

【讨论】:

  • 感谢 Pedro。但是如何在不使用 Inspector 的情况下获取 mailitem.EntryId。或者如何在 Inspector.CurrentItem 中获取当前的 Active 检查器?
  • 您在应用程序接口中有一个名为ActiveInspector 的方法,它返回最顶层的检查器。 Here 您拥有可以使用 Outlook 应用程序界面访问的允许操作和属性。
  • 我明白了。感谢您的帮助 Pedro.Outlook.MailItem item = (Outlook.MailItem)Globals.ThisAddIn.Application.ActiveInspector().CurrentItem;
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2015-12-17
  • 2011-09-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多