0
我一直在試圖找出一種方法來找出郵件已發送到的郵件地址。考慮以下幾點:從mailItem的收件人中獲取mailaddress
Private Sub Application_NewMailEx(ByVal EntryIDCollection As String)
Dim mai As MailItem
Dim intInitial As Integer
Dim intFinal As Integer
Dim strEntryId As String
Dim intLength As Integer
intInitial = 1
intLength = Len(EntryIDCollection)
intFinal = InStr(intInitial, EntryIDCollection, ",")
Do While intFinal <> 0
strEntryId = Strings.Mid(EntryIDCollection, intInitial, (intFinal - intInitial))
Set mai = Application.Session.GetItemFromID(strEntryId)
intInitial = intFinal + 1
intFinal = InStr(intInitial, EntryIDCollection, ",")
Loop
strEntryId = Strings.Mid(EntryIDCollection, intInitial, (intLength - intInitial) + 1)
MsgBox strEntryId
Set mai = Application.Session.GetItemFromID(strEntryId)
For Each Recipient In mai.Recipients
MsgBox Recipient
Next
End sub
在那些msgBoxes我得到的「好名」,如「李四」 - 但我想獲得的郵件地址,「[email protected]」。
我該如何做到這一點?
謝謝!
這是一個正確的假設。我正在使用Outlook 2010.我會馬上測試。謝謝! – Zyberzero