Sub GetOutlookContacts()
Dim olapp As Outlook.Application
Dim nspNameSpace As Outlook.Namespace
Dim fldContacts As Outlook.MAPIFolder
Dim objContact As Outlook.ContactItem
Dim iRow As Long
Dim sName As String
On Error Resume Next
Application.ScreenUpdating = False
Set olapp = New Outlook.Application
Set nspNameSpace = olapp.GetNamespace("MAPI")
Set fldContacts = nspNameSpace.GetDefaultFolder(olFolderContacts)
iRow = 1
Cells(iRow, 1).Resize(1, 5).Value = Array("Full Name", "First Name", "Middle Name", "Last Name", "Email Address 1")
For Each objContact In fldContacts.Items
With objContact
If objContact.Class = olContact Then
iRow = iRow + 1
Cells(iRow, 1).Value = .FullName
Cells(iRow, 2).Value = .FirstName
Cells(iRow, 3).Value = .MiddleName
Cells(iRow, 4).Value = .LastName
Cells(iRow, 5).Value = .Email1Address
ActiveSheet.Hyperlinks.Add Cells(iRow, 5), Cells(iRow, 5).Value
End If
End With
Next objContact
Application.ScreenUpdating = True
Set objContact = Nothing
Set fldContacts = Nothing
Set nspNameSpace = Nothing
Set olapp = Nothing
End Sub