Click or drag to resize

IFindContactsByPhone Method

find collection of Contacts using phone numbers Search and retrieve contacts by their phone number

Namespace:  SuperOffice.COM.SuperOfficeDB
Assembly:  SuperOfficeDB.Interop (in SuperOfficeDB.Interop.dll) Version: 8.0.0.0
Syntax
SOContacts ContactsByPhone(
	string Phone
)

Parameters

Phone
Type: SystemString
phone number to be used as a search argument (may be a partial number)

Return Value

Type: SOContacts
SOContacts – a collection of contacts matching ‘Phone’
Examples

ContactByPhone

This text may be copied to the notepad, and saved as a *.vbs file. Remember to change the login information.

The source code below logs on to the database, retrieves a SOFind object, and then uses it to search and the number of contacts with a phonenumber that starts with 22517000

VB
Dim objSO
Dim objFind
Dim objContacts
Dim objContact
Set objSO = CreateObject("SuperOfficeDB.Database")
If not (objSO is nothing) Then
    objSO.login "<USERID>", "<password>"
    set objFind = objSO.Find
    Set objContacts = objFind.ContactsByPhone ("22517000")
    set objContact = objContacts.GetFirst
    no = 1
    While Not objContacts.EOF
        no = no+1
        Set objContact = objContacts.GetNext
    Wend
    MsgBox "There were " & no & " contacts that matched the search criteria"
Else
    MsgBox "Could not log in"
End If
Set objSO = Nothing

See Also