捕获开始拖动事件邮件项目 [英] Catch start drag event mail item

查看:64
本文介绍了捕获开始拖动事件邮件项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我们正在将邮件存档到SharePoint文件夹中。我要做的是创建一个AddIn,在启动拖动事件时可以更改邮件的主题。我想在主题前面添加邮件的日期和时间。为了做到这一点,我正在寻找
来捕捉开始拖动邮件项目的事件。我该怎么做?

We are archiving mail into SharePoint folders. What i'm looking to do is to create a AddIn that on starting the drag event can change the subject of the mail. I want to add the date and time of the mail in front of the subject. In order to do this i'm looking to catch the event that starts the drag of a mail item. How can i do this?

我们正在使用Office 2013和Visual Studio 2015。

We are using Office 2013 and Visual Studio 2015.

推荐答案

Hello Jacob,

Hello Jacob,

Outlook对象模型(也不是VSTO) 没有提供任何用于检测此类操作的内容。您可以考虑处理

SelectionChange
当用户以编程方式选择不同的或附加的Microsoft Outlook项目或通过与用户界面交互时触发的Explorer类的事件
当用户(通过编程方式或通过用户界面)单击或切换到包含项目的其他文件夹时,也会发生此事件,因为Outlook会自动选择第一个项目该文件夹。

The Outlook object model (nor VSTO) doesn't provide anything for detecting such operations. You may consider handling the SelectionChange event of the Explorer class which is fired when the user selects a different or additional Microsoft Outlook item programmatically or by interacting with the user interface. This event also occurs when the user (either programmatically or via the user interface) clicks or switches to a different folder that contains items, because Outlook automatically selects the first item in that folder.

Public WithEvents myOlExp As Outlook.Explorer 
 
Public Sub Initialize_handler()  
 Set myOlExp = Application.ActiveExplorer  
End Sub  
 
Private Sub myOlExp_SelectionChange()  
 MsgBox myOlExp.Selection.Count & " items selected."  
End Sub


这篇关于捕获开始拖动事件邮件项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆