R
Ryan
I am trying to get a count of how many messages per date I have in my
generic inboxes. I have multiple inboxes I manage and need to count the
messages by day. This code work for MY inbox only, not the generic inboxes.
Any help? Thanks!!
Const olFolderInbox = 6
Set objDictionary = CreateObject("Scripting.Dictionary")
Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set objFolder = objNamespace.GetDefaultFolder(olFolderInbox)
Set colItems = objFolder.Items
For Each objItem in colItems
strDate = FormatDateTime(objItem.SentOn, vbShortDate)
If objDictionary.Exists(strDate) Then
objDictionary.Item(strDate) = objDictionary.Item(strDate) + 1
Else
objDictionary.Add strDate, "1"
End If
Next
colKeys = objDictionary.Keys
For Each strKey in colKeys
Wscript.Echo strKey, objDictionary.Item(strKey)
Next
generic inboxes. I have multiple inboxes I manage and need to count the
messages by day. This code work for MY inbox only, not the generic inboxes.
Any help? Thanks!!
Const olFolderInbox = 6
Set objDictionary = CreateObject("Scripting.Dictionary")
Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set objFolder = objNamespace.GetDefaultFolder(olFolderInbox)
Set colItems = objFolder.Items
For Each objItem in colItems
strDate = FormatDateTime(objItem.SentOn, vbShortDate)
If objDictionary.Exists(strDate) Then
objDictionary.Item(strDate) = objDictionary.Item(strDate) + 1
Else
objDictionary.Add strDate, "1"
End If
Next
colKeys = objDictionary.Keys
For Each strKey in colKeys
Wscript.Echo strKey, objDictionary.Item(strKey)
Next