Friday, 23 August 2013

Retreive more than one folder of type olFolderContacts

Retreive more than one folder of type olFolderContacts

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?

No comments:

Post a Comment