PDA

View Full Version : Outlook Contacts



joms
11-05-2013, 02:51 PM
hi gurus,

is it possible to get all the address contact folder using vba?

what i mean in outlook there is contact folder, and beneath it you can create a lot of folders, like contact1, contact2, contact3 and so on..

how do i get all the address book name of these folder using vba?

Thanks for any input :)

skatonni
11-05-2013, 07:03 PM
Set myNameSpace = Application.GetNamespace("MAPI")
Set myDefaultContacts = myNameSpace.GetDefaultFolder(olFolderContacts)


If contact1 is a folder under the default folder:
Set mySubContacts1 = myDefaultContacts.Folders("contact1")


If contact1 is a folder at the same level as the default folder:
Set mySubContacts1 = myDefaultContacts.Parent.Folders("contact1")