[FONT=Courier New][COLOR=darkblue]Option[/COLOR] [COLOR=darkblue]Explicit[/COLOR]
[COLOR=darkblue]Sub[/COLOR] test()
[COLOR=darkblue]Dim[/COLOR] oDict [COLOR=darkblue]As[/COLOR] Scripting.Dictionary
[COLOR=darkblue]Dim[/COLOR] olApp [COLOR=darkblue]As[/COLOR] Outlook.Application
[COLOR=darkblue]Dim[/COLOR] olNS [COLOR=darkblue]As[/COLOR] Outlook.Namespace
[COLOR=darkblue]Dim[/COLOR] olFolder [COLOR=darkblue]As[/COLOR] Outlook.MAPIFolder
[COLOR=darkblue]Dim[/COLOR] olItem [COLOR=darkblue]As[/COLOR] [COLOR=darkblue]Object[/COLOR]
[COLOR=darkblue]Dim[/COLOR] arrData() [COLOR=darkblue]As[/COLOR] [COLOR=darkblue]Variant[/COLOR]
[COLOR=darkblue]Dim[/COLOR] CategoryCnt [COLOR=darkblue]As[/COLOR] [COLOR=darkblue]Integer[/COLOR]
[COLOR=darkblue]Dim[/COLOR] c [COLOR=darkblue]As[/COLOR] [COLOR=darkblue]Long[/COLOR]
[COLOR=darkblue]Set[/COLOR] oDict = [COLOR=darkblue]New[/COLOR] Scripting.Dictionary
[COLOR=darkblue]Set[/COLOR] olApp = [COLOR=darkblue]New[/COLOR] Outlook.Application
[COLOR=darkblue]Set[/COLOR] olNS = olApp.GetNamespace("MAPI")
[COLOR=darkblue]Set[/COLOR] olFolder = olNS.GetDefaultFolder(olFolderInbox)
CategoryCnt = olNS.Categories.Count
[COLOR=darkblue]ReDim[/COLOR] arrData(1 [COLOR=darkblue]To[/COLOR] 2, 1 [COLOR=darkblue]To[/COLOR] CategoryCnt)
c = 0
[COLOR=darkblue]For[/COLOR] [COLOR=darkblue]Each[/COLOR] olItem [COLOR=darkblue]In[/COLOR] olFolder.Items
[COLOR=darkblue]If[/COLOR] [COLOR=darkblue]Not[/COLOR] oDict.Exists(olItem.Categories) [COLOR=darkblue]Then[/COLOR]
c = c + 1
arrData(1, c) = olItem.Categories
arrData(2, c) = 1
oDict.Add olItem.Categories, c
[COLOR=darkblue]Else[/COLOR]
arrData(2, oDict.Item(olItem.Categories)) = arrData(2, oDict.Item(olItem.Categories)) + 1
[COLOR=darkblue]End[/COLOR] [COLOR=darkblue]If[/COLOR]
[COLOR=darkblue]Next[/COLOR] olItem
[COLOR=darkblue]ReDim[/COLOR] [COLOR=darkblue]Preserve[/COLOR] arrData(1 To 2, 1 To c)
Range("A2").Resize(UBound(arrData, 2), UBound(arrData, 1)).Value = Application.Transpose(arrData)
[COLOR=darkblue]End[/COLOR] [COLOR=darkblue]Sub[/COLOR]
[/FONT]