populating list box with contacts
"GeorgeFD29" wrote:
I am trying to populate a list box in excel with the FirstName object of my
outlook2000 contacts; then when the user selects a FirstName, I retrieve
items like email address for the contact they selected and store to a cell in
the sheet.
I feel like Edison working on the light bulb. Any help would be greatly
appriciated.
Thanks,
George
I have the following code working - talking to outlook. However, whenever I
try to return the email address of the contact, I get 'object doesn't support
this property or method' thanks for any help.
Dim OLF As Outlook.MAPIFolder
Dim olContactItem As Outlook.ContactItem
Dim ToContact As Recipient
Set OLF = GetObject("",
"Outlook.Application").GetNamespace("MAPI").GetDef aultFolder(olFolderContacts)
Set itms = OLF.Items
If itms.Count = 0 Then
MsgBox "No contacts to add to drop-down list"
Exit Sub
End If
For i = 1 To itms.Count
Set itm = itms(i)
strContactName = itm.LastName & ", " & itm.FirstName & " " & itm.MiddleName
strEmail = itm.email
Next
|