I have a small piece of code in which I just try to retrieve the names of all Outlook contacts and put them in a listbox.
This gives me a runtime error '13': Type mismatch at the last line of code (Next objEntry):

Dim objOutlook As New Outlook.Application
Dim objNameSpace As Outlook.NameSpace
Dim objContacts As MAPIFolder
Dim objEntry As ContactItem


'Get the MAPI reference
Set objNameSpace = objOutlook.GetNamespace("MAPI")

'Pick up the Contacts
Set objContacts = objNameSpace.GetDefaultFolder(olFolderContacts)

'Loop through the folders under the Inbox
For Each objEntry In objContacts.Items
lstfolders.AddItem objEntry.LastName
Next objEntry


Any idea's ???