標題:
[發問]
如何得知此次outlook共接收了幾封新郵件?
[打印本頁]
作者:
PKKO
時間:
2015-8-6 18:35
標題:
如何得知此次outlook共接收了幾封新郵件?
Private Sub Application_NewMailEx(ByVal EntryIDCollection As String)
MsgBox "I'm working!", vbExclamation
Dim varEntryIDs
Dim objItem As Object
Dim myItem As MailItem
Dim i As Integer
varEntryIDs = Split(EntryIDCollection, ",")
For i = 0 To UBound(varEntryIDs)
Set objItem = Application.Session.GetItemFromID(varEntryIDs(i))
'## Check the item's TypeName and ONLY process if it's a MailItem:
If TypeName(objItem) = "MailItem" Then
Set myItem = objItem.Forward
myItem.Recipients.Add "
[email protected]
"
myItem.Send
Else:
MsgBox "Type of item is: " & TypeName(objItem)
End If
Next
End Sub
複製代碼
這是網路上找到的資料
但只能找出最後一封mail
如何可以得知此次接收了五封mail
而不是只抓的到最後一封信呢?
請各位大大求助!
歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)