Outlook 问题 API - 拖放

Problems with the Outlook API - Drag and Drop

我有一个带有 TreeView 的 Outlook 插件。

我知道用户何时拖动电子邮件但我不知道如何识别用户何时拖动文件夹

识别拖拽的对象后,如果是文件夹,会按照下面代码的步骤获取CurrentFolder,对文件夹下的所有邮件进行传递和发布

Outlook.Application outlookApplication = Globals.ThisAddIn.Application;
Outlook.Explorer outlookExplorer = (Outlook.Explorer)outlookApplication.ActiveExplorer();
Outlook.Selection selection = outlookExplorer.Selection;
Outlook.Folder folder = (Outlook.Folder)outlookExplorer.CurrentFolder;
Outlook.Items items = folder.Items;
Outlook.MailItem mail = null;

for (int i = 1; i <= items.Count; i++) 
{
    if (items[i] is Outlook.MailItem)
    {
        mail = (Outlook.MailItem)items[i]; 
        // Here I have all the mails and the plugin works to publish one or more mails like a Outlook.MailItems
    }
}

有人知道我该如何解决这个问题吗?

大家好,我找到了一个非常丑陋的解决问题的方法,但这是我需要的。

如果 args 存在很多属性,其中一个属性仅在我拖动文件夹时出现。看代码。

if (e.Data.GetDataPresent("UniformResourceLocator"))
{
    // This step it's true only with a folder 
}
else
{
    // This step it's to others items like MailItem, ContactItem...
}

总有一天它会对某人有用。

问候 !!!