我想获取来自特定发件人的未读邮件的电子邮件地址。我尝试了以下代码,但它不起作用
Set olApp=CreateObject("Outlook.Application")
Set olMAPI=olApp.GetNameSpace("MAPI")
Set oFolder = olMAPI.GetDefaultFolder(6)
Set allEmails = oFolder.Items
For Each email In oFolder.Items
If email.Unread = True Then
If email.SenderEmailAddress="Kalyanam.Raghuram@xxxx.com" Then
MsgBox email.Subject
End If
End If
Next
所以我通过插入此代码检查了“email.SenderEmailAddress”实际上正在验证的内容
For Each email In oFolder.Items
If email.Unread = True Then
MsgBox email.Subject
MsgBox email.SenderEmailAddress
End If
Next
它给了我一些无法理解但可读的输出。请让我知道任何解决方案。