Retrieve special folders that are not “default” outlook
I'm looping through each folder of my outlook store in my code and used to check the folder type by retreiving all default folders and compare their entry ID like the following.
Public Function GetFolderTypeName(objFolder) Dim objType, objDefaultFolder 'dctValidFolders is a dictionary of default folders type For Each objType in dctValidFolders Set objDefaultFolder = objMAPI.GetDefaultFolder(dctValidFolders.Item(objType)) If objFolder.EntryID = objDefaultfolder.EntryID Then Set objDefaultfolder = Nothing GetFolderTypeName = objType Exit Function End If Next End Function
Now, I'm looping through a mailbox that has more than 1 folder of type contacts. What now?
Is there basically no other way to know the folder type?
There was in fact, check
This will return an item type , like olMailItem, and depending on that you can "assume" the folder type.