1

我正在使用 VS 2010 ,Dot Net Framework 2.0 。我在 Extensibility->Shared Add-ins for Outlook 中创建了一个项目。

我想使用 Com Add-in 创建一个后续电子邮件提醒,任何人都可以帮助我如何做到这一点。我已经编写了一些代码并在电子邮件中附加了关注标志,但找不到在其上附加提醒的方法,调用提醒,检查关注标志是否已经附加到邮件项,我可以用我自己的自定义窗口覆盖默认提醒窗口. 这是代码。

explorer = this.Application.ActiveExplorer();
        explorer.SelectionChange += new Outlook.ExplorerEvents_10_SelectionChangeEventHandler(explorer_SelectionChange);

        void explorer_SelectionChange()
    {
        if (connectingMailItem != null && connectingMailItem is Outlook.MailItem)
        {
            Marshal.ReleaseComObject(connectingMailItem);
            // Perform a Garbage Collection
            GC.Collect();
            connectingMailItem = null;
            return;
        }
        foreach (object selectedItem in explorer.Selection)
        {
            connectingMailItem = selectedItem as Outlook.MailItem;
            break;
        }
        if (connectingMailItem != null && connectingMailItem is Outlook.MailItem)
        {                
            connectingMailItem.FlagRequest = "Follow up";             
            connectingMailItem.Save();
        } 
    }

应该在此代码中添加什么以实现我的目标谢谢

这是创建跟进提醒应该做的事情

if (connectingMailItem.IsMarkedAsTask == true)
            {
                connectingMailItem.ClearTaskFlag();
            }
            else
            {                    
                connectingMailItem.FlagRequest = "Follow up";
                connectingMailItem.FlagIcon = Outlook.OlFlagIcon.olNoFlagIcon;                    
                connectingMailItem.MarkAsTask(Outlook.OlMarkInterval.olMarkToday);
                connectingMailItem.ReminderTime = DateTime.Now.AddMinutes(1);
                connectingMailItem.ReminderOverrideDefault = true;
                connectingMailItem.ReminderSet = true;
                connectingMailItem.Save();
            }

但我无法覆盖默认提醒窗口并显示自定义 winform

4

0 回答 0