Click or drag to resize

IFindPersonsByName Method

find collection of Persons by first and/or last name Search and retrieve persons by their name

Namespace:  SuperOffice.COM.SuperOfficeDB
Assembly:  SuperOfficeDB.Interop (in SuperOfficeDB.Interop.dll) Version: 8.0.0.0
Syntax
SOPersons PersonsByName(
	string FirstName,
	string LastName
)

Parameters

FirstName
Type: SystemString
Persons given name (may use partial name)
LastName
Type: SystemString
Persons surname (may use partial name)

Return Value

Type: SOPersons
SOPersons a collection of persons matching Name
Examples

PersonsByName

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

This example logs on to the database and search for persons with the name John Doe. Then returns the name of the company this person is associated with.

VB
Dim objSO
Dim objPerson 
Set objSO = CreateObject("SuperOfficeDB.Database")
If not (objSO is nothing) Then
    objSO.login "<USERID>", "<password>"   
    set objPerson = objSO.Find.PersonsByName("John", "Doe")
    set Person = objPerson.getfirst
    while not objPerson.eof
        item = Person.contact.name 
        msgbox "The search returned persons from this company: " & item
        set Person = objPerson.Getnext
    wend
Else
    MsgBox "Could not log in"
End If
Set objSO = Nothing

See Also