C# Outlook 插件 - 在 ItemSend 上显示表单

C# Outlook addin - Display form on ItemSend

我刚开始使用 C# 开发插件,如果这是一个简单的问题,我深表歉意。

基本上,我正在尝试创建一个插件,一旦用户点击发送,它就会打开一个表单,用户可以使用该表单来 select 邮件分类。

我已经设置了表格,但是在发送项目时我无法调用表格。

到目前为止我得到的是:

  private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
    Application.ItemSend += new 
        Outlook.ApplicationEvents_11_ItemSendEventHandler(FormRegion1);
}

如有任何帮助,我们将不胜感激。

感谢您抽出宝贵的时间进行高级

您需要为 ItemSend 事件添加事件处理程序:

private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
    this.Application.ItemSend += new Microsoft.Office.Interop.Outlook.ApplicationEvents_11_ItemSendEventHandler(Application_ItemSend);
}

void Application_ItemSend(object Item, ref bool Cancel)
{
    if (Item is Outlook.MailItem)
    {
        Form1 f = new Form1();
        f.Show();
    }
}