Tuesday, March 06, 2012 3:04 AM
in Outlook 2010, you add new contact group folder (or called distribution list from earlier version?).
I know it is easy to get the default contact folder "Contacts" as well as the "Suggested Contacts".
How about user created ones?
Tuesday, March 06, 2012 9:08 AM
The process is much the same e.g as follows, where Foldername is the name of the personal folder.
Dim olNS As Outlook.NameSpace
Dim olContactFolder As Outlook.MAPIFolder
Dim olContact As Outlook.ContactItem
Dim olItems As Outlook.Items
On Error Resume Next
Set olNS = GetNamespace("MAPI")
Set olContactFolder = olNS.GetDefaultFolder(olFolderContacts).Folders("Foldername")
Set olItems = olContactFolder.Items
For Each olContact In olItems
'Do what you want here with olContact
Set olItems = Nothing
Set olNS = Nothing
Set olContactFolder = Nothing
Set olContact = Nothing
Graham Mayor - Word MVP
Tuesday, March 06, 2012 2:44 PMolContactFolder.Parent.Folders("Foldername") works for any contact folders.