Print all names from your contact list in Outlook : Outlook Contact « Outlook « VBA / Excel / Access / Word






Print all names from your contact list in Outlook

 
Sub myAddressBook()
   Dim myOutlook As Outlook.Application
   Dim myInformation As Namespace
   Dim mycontacts As Items
   Dim myItems As ContactItem

   Set myOutlook = CreateObject("Outlook.Application")
   Set myInformation = myOutlook.GetNamespace("MAPI")
   Set mycontacts = myInformation.GetDefaultFolder(olFolderContacts).Items

   For Each myItems In mycontacts
      Debug.Print myItems.FirstName, myItems.LastName, myItems.Email1Address
    Next
End Sub

 








Related examples in the same category

1.Add new contact item to Outlook
2.Delete a contact from Outlook
3.Create Outlook.Application
4.add a contact through VBA
5.Add recipient