我到处寻找这个东西,但还没有运气。我有一个加载项(用于 Outlook),它对 Outlook 项目(约会项目、任务)执行多项操作。当您将文件拖到项目主体上并显示在项目主体上时,我只想覆盖该事件。我只希望附加该项目(并将其存储在我选择的目录中)。我如何链接事件?我发现了一个事件。
但在这个例子中,总是有一个表格。我没有特定的表格,因为它是一个加载项:(
private void Body_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)
    {
        // Ensure that the list item index is contained in the data. 
        if (e.Data.GetDataPresent(typeof(System.String)))
        {
            Object item = (object)e.Data.GetData(typeof(System.String));
            // Perform drag-and-drop, depending upon the effect. 
            if (e.Effect == DragDropEffects.Copy ||
                e.Effect == DragDropEffects.Move)
            {
                // Insert the item. 
                System.Windows.Forms.MessageBox.Show("there");
            }
        }
    }
我找到了其余的详细信息,但找不到要覆盖的事件。
请帮忙。提前致谢。
编辑:
我添加约会的代码是:
public bool getAppointments(IList<IAppointmentData> list)
        {
            Microsoft.Office.Interop.Outlook.Application outlookApp = new Microsoft.Office.Interop.Outlook.Application();
            Microsoft.Office.Interop.Outlook.Explorer expl =  outlookApp.ActiveExplorer();
            try
            {
                if (list.Count != 0)
                {
                    deleteExisting();
                    foreach (IAppointmentData appointmentData in list)
                    {
                        Microsoft.Office.Interop.Outlook._AppointmentItem appt = (Microsoft.Office.Interop.Outlook.AppointmentItem)
                            outlookApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olAppointmentItem);
                        appt = setMeetingDetails(appt, appointmentData);
                        appt.Recipients.ResolveAll();
                        appt.Save();
                    }
                }
            }
            catch (System.Exception e)
            {
                System.Windows.Forms.MessageBox.Show(e.ToString());
                return false;
            }
            return true;
        }
当有人将文件放入正文时,我需要一些机制将上面列出的事件附加到约会项目正文中。我该怎么做?