简体   繁体   English

如何在 Outlook 中通过 vba 对电子邮件进行分类和发送时进行跟踪?

[英]How to track when email is categorized and sent via vba in outlook?

I had such a problem: In my company we are using outlook as a main tool for daily work.我遇到了这样一个问题:在我的公司,我们使用 Outlook 作为日常工作的主要工具。 The whole things starts when emploee assigned a category to mail and ends when this mail is sent.整个事情从员工为邮件分配一个类别开始,并在发送此邮件时结束。 I would like to extract data when particular mail was categorized (date and hour, name of category) and when it was send (the same like previously) + subject of this mail, to excel worksheet.我想在对特定邮件进行分类(日期和时间,类别名称)以及何时发送(与以前相同)+这封邮件的主题时提取数据,以生成 Excel 工作表。 I have planned to add such macro into ThisOutlookSession but currently i had no idea how to extract category events from outlook, i've been able only extract info when email was send.我计划将这样的宏添加到 ThisOutlookSession 但目前我不知道如何从 Outlook 中提取类别事件,我只能在发送电子邮件时提取信息。 Any advice?有什么建议吗?

You need to handle the PropertyChange event which is fired when an explicit built-in property (for example, Categories ) of the object is changed.您需要处理在更改对象的显式内置属性(例如Categories )时触发的PropertyChange事件。 The name of the property that was changed is passed as a parameter to the event handler.更改的属性的名称作为参数传递给事件处理程序。 For example, a raw sketch:例如,原始草图:

 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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何更改通过Excel VBA代码通过Outlook发送的电子邮件的字体格式? - How to change the font formatting on an email sent through Outlook via Excel VBA code? 从 Excel 通过 Outlook 发送电子邮件时如何处理错误? - How to handle errors when an email is sent from Excel through Outlook? 通过Outlook从VBA自动发送电子邮件 - automatic email via Outlook from vba 发送 email 时如何显示 MsgBox? Excel VBA - How can I display a MsgBox when the email is sent? Excel VBA Excel VBA:已发送的Outlook电子邮件不包含粘贴的范围 - Excel VBA: Sent Outlook email does not include pasted Range 使用 VBA 通过 Outlook 发送的电子邮件卡在发件箱中 - Emails sent via Outlook using VBA stuck in outbox 如何使VBA通过单击链接或在其他人收到电子邮件时单击Outlook电子邮件来运行? - How to get VBA to run through the click of a link or once clicked in Outlook email when someone else recieves the email? 如何使用 Excel Z6E3EC7E6A9F6007B4838FC0EE793A809 通过 Gmail 发送 email? 无法将消息发送到 SMPT 服务器 - How to send email via Gmail using Excel VBA? The message could not be sent to the SMPT server 如何使用 VBA 将图像嵌入 Outlook email - How to embed an image into an Outlook email using VBA 如何将 VBA 中的换行符用于 outlook email - How to use line breaks in VBA for an outlook email
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM