Good morning everybody:
I am attempting to populate a listview control on Form Load()
and I get a Run-Time Error: 380 - Invalid property value. Below is the line to generates the error:
lvw.ListItems(lvw.ListItems.Count).SubItems(1) = OutlookAddressEntry.Address
Below is alos my entire FormLoad module:
Private Sub Form_Load()
Set OutlookApp = New Outlook.Application
Set OutlookMailItem = OutlookApp.CreateItem(olMailItem)
Set OutlookNameSpace = OutlookApp.GetNamespace("MAPI")
lvw.ListItems.Clear
For Each OutlookAddressList In OutlookNameSpace.AddressLists
For Each OutlookAddressEntry In OutlookAddressList.AddressEntries
lvw.ListItems.Add , , OutlookAddressEntry.Name
lvw.ListItems(lvw.ListItems.Count).SubItems(1) = OutlookAddressEntry.Address
lvw.ListItems(lvw.ListItems.Count).SubItems(2) = OutlookAddressEntry.ID
lvw.ListItems(lvw.ListItems.Count).Tag = OutlookAddressEntry.ID
Next
Next
End Sub
Any help will b greatly appreciated
Thanks,
tgifgemini.