Application_ItemSend中缺少Outlook MailItem属性 [英] Missing Outlook MailItem Properties in Application_ItemSend
问题描述
我有下面的代码,其中SenderName MailItem属性显示为空白.
I have the code below in which the SenderName MailItem property appears blank.
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
也许是一些男生错误,并且会感谢我所缺少的指示.
Some schoolboy error perhaps and will appreciate pointers as to what I am missing.
Outlook 2013 Windows 7
Outlook 2013 Windows 7
推荐答案
仅在实际发送邮件并将其移至已发送邮件"文件夹后,才会填充与发件人相关的属性.到Application.ItemSend事件触发时,消息仍未发送.
Sender related properties are populated only after the message is actually sent and moved to the Sent Items folder. By the time Application.ItemSend event fires, the message is still unsent.
最早访问具有所有属性填充的已发送消息的位置是已发送Itens"文件夹中的Items.ItemAdd事件.
The earliest you can access the sent message with all the properties populated is in the Items.ItemAdd event on the Sent Itens folder.
这篇关于Application_ItemSend中缺少Outlook MailItem属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!