Hi, I have this strange problem. I can get the data from outlook 2000 but i can't get the data out of "set" the variables without an run-time 91 error.



Private Sub Command1_Click()
Dim Number, PhoneNumber As String
Number = "40568886"

If Len(Number) = 8 Then
PhoneNumber = """+45 " & Mid$(Number, 1, 2) & " " & Mid$(Number, 3, 2) & " " & Mid$(Number, 5, 2) & " " & Mid$(Number, 7, 2) & """"
End If


Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set mycontacts = myNameSpace.GetDefaultFolder(olFolderContacts)
Set myhomephone = mycontacts.Items.Find("[HomeTelephoneNumber] = " & PhoneNumber)
Set myBusinessPhone = mycontacts.Items.Find("[BusinessTelephoneNumber] = " & PhoneNumber)
Set myMobilePhone = mycontacts.Items.Find("[MobileTelephoneNumber] = " & PhoneNumber)

If myhomephone = "" Then Exit Sub