You can use the Restrict method. Here's an example built from the one in
the Help file:
Public Sub ContactPhoneNumber()
Dim myOlApp As Outlook.Application
Dim myNamespace As Outlook.NameSpace
Dim myContacts As Outlook.Items
Dim myItems As Outlook.Items
Dim myItem As Object
Set myOlApp = CreateObject("Outlook.Application")
Set myNamespace = myOlApp.GetNamespace("MAPI")
Set myContacts = myNamespace.GetDefaultFolder(olFolderContacts).Items
Set myItems = myContacts.Restrict("[BusinessTelephoneNumber] = '+1 (555)
555-1234'")
For Each myItem In myItems
If (myItem.Class = olContact) Then
Debug.Print myItem.FullName
End If
Next
End Sub
--
Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog:
http://blogs.officezealot.com/legault/
Angus Comber said:
Hello
In Outlook I can use the Find Items feature to find a contact.
Eg I can look for 01222 & 456789
How can I do the same using VB?
Angus