excel - 如何跟踪电子邮件何时分类?
问题描述
我们使用 Outlook 作为日常工作的主要工具。
它在员工为邮件分配类别时开始,并在发送此邮件时结束。
我想在发送邮件时提取邮件的分类时间(日期和时间,类别名称)以及此邮件的主题,并将其提取到 Excel 工作表中。
我计划将这样的宏添加到 ThisOutlookSession 中。我不知道如何从 Outlook 中提取类别事件。
我只能在发送电子邮件时提取?
解决方案
您需要处理在对象的显式内置属性(例如Categories)发生更改时触发的PropertyChange事件。已更改的属性名称作为参数传递给事件处理程序。例如,原始草图:
Private WithEvents olExplorer As Outlook.Explorer
Private olCurSel As Selection
Private WithEvents olCurSelItem As Outlook.MailItem
Private Sub olExplorer_SelectionChange()
Set olCurSel = olExplorer.Selection
Set olCurSelItem = Nothing
If TypeName(olCurSel.Item(1)) = "MailItem" Then
Set olCurSelItem = olCurSel.Item(i)
End If
End Sub
Private Sub olCurSelItem_PropertyChange(ByVal Name As String)
Debug.Print Name
End Sub
推荐阅读
- sql-server - 在 pentaho CDE 中通过 jdbc 查询将字符串参数传递给 SQL
- spring-security - 如何为不同的文件扩展名设置安全 URL 模式,例如 .xhtml、.jpg、.docx
- r - 如何在R中解析人名
- callback - 如何将方法作为回调传递
- python - 熊猫在列之间相乘不起作用
- swift - ARKit 3.0 – 带有动作捕捉的人物遮挡
- c# - ASP.NET Core 忽略属性或在 ModelState 上将其设置为有效
- python - VSCode 运行不同的程序?
- reactjs - 没有生成 React 类
- continuous-integration - 从 bitbucket Webhooks 触发竹计划