|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
本帖最后由 hlssoft 于 2012-9-20 17:07 编辑
以下是outlook帮助里关于NewMailEx的一段代码,烦请高手给红字的部分注释一下,本人实在看不懂,多谢了:
Public WithEvents outApp As Outlook.Application
Sub Intialize_Handler()
Set outApp = Outlook.Application
End Sub
Private Sub outApp_NewMailEx(ByVal EntryIDCollection As String)
Dim mai As Object
Dim intInitial As Integer
Dim intFinal As Integer
Dim strEntryId As String
Dim intLength As Integer
intInitial = 1
intLength = Len(EntryIDCollection)
MsgBox "Collection of EntryIds: " & EntryIDCollection
intFinal = InStr(intInitial, EntryIDCollection, ",")
Do While intFinal <> 0
strEntryId = Strings.Mid(EntryIDCollection, intInitial, (intFinal - intInitial))
MsgBox "EntryId: " & strEntryId
Set mai = Application.Session.GetItemFromID(strEntryId)
MsgBox mai.Subject
intInitial = intFinal + 1
intFinal = InStr(intInitial, EntryIDCollection, ",")
Loop
strEntryId = Strings.Mid(EntryIDCollection, intInitial, (intLength - intInitial) + 1)
MsgBox strEntryId
Set mai = Application.Session.GetItemFromID(strEntryId)
MsgBox mai.Subject
End Sub
以上代码已知道,有以下问题。
版主:
1、EntryIDCollection里的数据应该是用逗号分开的一维数组的形式吧?
2、EntryIDCollection里面的数据是由邮件服务器给的还是本地outlook给的?
3、ReceivedTime和SentOn这两个属性分别是由发送方、服务器、接收方哪一方决定的,有时看到ReceivedTime的时间比SentOn要早,有时前者又比后者晚,好像没有规律?
本人刚刚学习outlookVBA,多有不明白,烦请版主明示,多谢了!
|
|