Application_ItemSend 中缺少 Outlook MailItem 属性

Missing Outlook MailItem Properties in Application_ItemSend

我有下面的代码,其中 SenderName MailItem 属性 显示为空白。

Private Sub Application_ItemSend(ByVal MyItem As Object, Cancel As Boolean)
    Dim res As Integer

    ' The "Class" MailItem property is found
    If MyItem.Class = olMail Then

        ' This is coming up blank
        ' The "SenderName" MailItem property is not apparent
        MsgBox MyItem.SenderName

        res = MsgBox("Archive outgoing email?", vbQuestion + vbYesNo, "XYZ")
        If res = vbYes Then
            Call ProcessIt(MyItem)
        Else
            Cancel = True
        End If
    End If
End Sub

有些小学生可能会犯错误,但会感谢您指出我遗漏了什么。

展望 2013 Windows7

只有在邮件实际发送并移动到“已发送邮件”文件夹后,才会填充与发件人相关的属性。到 Application.ItemSend 事件触发时,消息仍未发送。

您最早可以访问已填充所有属性的已发送邮件是在“已发送邮件”文件夹的 Items.ItemAdd 事件中。