【问题标题】:Searching Outlook 2010 Meeting Request Events c#搜索 Outlook 2010 会议请求事件 c#
【发布时间】:2011-07-14 20:41:39
【问题描述】:

我将在会议请求 (MeetingItem / AppointmentItem) 中签入 Outlook(对于 Outlook 插件),添加收件人。 我正在自行在 MeetingItem / AppointmentItem 中搜索事件/可能性... 到目前为止我还没有发现任何事件,这对收件人负责。 有人可以给我一个提示我应该如何进行吗?

谢谢 马丁

【问题讨论】:

    标签: c# events ms-office outlook-addin outlook-2010


    【解决方案1】:

    我已经弄清楚如何知道收件人是否已更改,该事件会在约会项中的任何更改时触发,但我可以使用名称进行过滤。

    readonly Outlook.Application _outlookApp = new Outlook.Application();
    
    private void ThisAddIn_Startup(object sender, System.EventArgs e)
    {
        _outlookApp.ItemLoad += new Outlook.ApplicationEvents_11_ItemLoadEventHandler(test_ItemLoad);
    }
    
    void test_ItemLoad(object item)
    {
        if (item is Outlook.AppointmentItem)
        {
            var appt = item as Outlook.AppointmentItem;
            appt.PropertyChange += new ItemEvents_10_PropertyChangeEventHandler(appt_PropertyChange);
        }
    }
    
    void appt_PropertyChange(string name)
    {
        MessageBox.Show(string.Format("Name: {0}", name));
        xxx
    }
    

    xxx:在这里,我现在想检查一下该项目的收件人,如果它发生了变化。不幸的是,我不知道如何回到我的约会项目....

    【讨论】:

      【解决方案2】:

      找到了解决 ItemSend 事件的方法:

              readonly Outlook.Application _outlookApp = new Outlook.Application();
      
          private void ThisAddIn_Startup(object sender, System.EventArgs e)
          {
              _outlookApp.ItemSend += new ApplicationEvents_11_ItemSendEventHandler(OutlookAppItemSend);
          }
      
          void OutlookAppItemSend(object item, ref bool cancel)
          {
              if (item is Outlook.AppointmentItem)
              {
                  var appt = item as Outlook.AppointmentItem;
                  foreach (Outlook.Recipient recipient in appt.Recipients)
                  {
                      MessageBox.Show(string.Format("Rctp {0} ", recipient.Name));
                  }
      
              }....
      

      【讨论】:

        猜你喜欢
        • 2017-06-10
        • 2011-02-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2010-10-02
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多