Q
Question Boy
Hello,
I'm trying to return a listing of contacts from a specific folder. I can
get it to work with the default Contact folder, but cannot get it to use
another folder. Below works, but only for the default contact folder. how
would I need to mod it for a specific folder such as "Business"?
**********
Set myOlApp = CreateObject("Outlook.Application")
Set myNamespace = myOlApp.GetNamespace("MAPI")
'Set MyContacts = myNamespace.GetDefaultFolder(olFolderContacts).Items
Set MyItems = MyContacts
MyItems.Sort "LastName", False 'Sort the entries alphabetically based on
their last names
For Each MyItem In MyItems
List0.AddItem Item:=MyItem.FullName ' add to listbox
Next
**********
Thank you,
QB
I'm trying to return a listing of contacts from a specific folder. I can
get it to work with the default Contact folder, but cannot get it to use
another folder. Below works, but only for the default contact folder. how
would I need to mod it for a specific folder such as "Business"?
**********
Set myOlApp = CreateObject("Outlook.Application")
Set myNamespace = myOlApp.GetNamespace("MAPI")
'Set MyContacts = myNamespace.GetDefaultFolder(olFolderContacts).Items
Set MyItems = MyContacts
MyItems.Sort "LastName", False 'Sort the entries alphabetically based on
their last names
For Each MyItem In MyItems
List0.AddItem Item:=MyItem.FullName ' add to listbox
Next
**********
Thank you,
QB