Rob@SYPTE
July 2nd, 2001, 07:20 AM
Help please,
I am trying to read the outlook 97 address book into a combo box with the following code but it gives an error.
Object does not support this property or method
Dim myOlApp As Object
Dim myNameSpace As Object
Dim myAddressList As Object
Dim myAddressEntries As Object
Dim i As Integer
Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myAddressList = myNameSpace.AddressLists("Contacts")
Set myAddressEntries = myAddressList.AddressEntries
With cboFaxNumbers
.AddItem myAddressEntries.GetFirst
For i = 2 To myAddressEntries.Count
.AddItem myAddressEntries.GetNext
Next i
End With
Help appreciated
Cheers
Rob
I am trying to read the outlook 97 address book into a combo box with the following code but it gives an error.
Object does not support this property or method
Dim myOlApp As Object
Dim myNameSpace As Object
Dim myAddressList As Object
Dim myAddressEntries As Object
Dim i As Integer
Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myAddressList = myNameSpace.AddressLists("Contacts")
Set myAddressEntries = myAddressList.AddressEntries
With cboFaxNumbers
.AddItem myAddressEntries.GetFirst
For i = 2 To myAddressEntries.Count
.AddItem myAddressEntries.GetNext
Next i
End With
Help appreciated
Cheers
Rob