Good afternoon to you all.
Against the problem to return to the caller the number of unread msgs
waiting in its mailbox onto the company Exchange Server 6.5, I wrote the
below class using MAPI:
[it's a "special" subset, I can provide the whole class]
For Each objInfoStore In objInfoStores
If objInfoStore.ProviderName = "Microsoft Exchange Message Store"
Then
Set objRootFolder = objInfoStore.RootFolder
If objRootFolder.Name <> "IPM_SUBTREE" Then
Set objFolders = objInfoStore.RootFolder.Folders
For Each objSubFolder In objFolders
Set objFields = objSubFolder.Fields
Set objField = objFields.Item(CDO_PR_CONTENT_UNREAD)
MsgBox objSubFolder.Name & CStr(objField.Value)
Next objSubFolder
End If
End If
Next objInfoStore
What do you think? Is there a way to get the same with a quicker code? Or
much better w/o using MAPI?
And last but not least I found that two actions are above all very slow:
1) Set objMAPISession = CreateObject("MAPI.Session")
2) objMAPISession.Logoff
Expecially the logoff needs seconds!!
Any succestion?
All the best
P.S. one person=one infostore (not to speak about PF)? Or his/her mails
could be spreaded between infostore?
|