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
SyntaxSOPersons PersonsByName(
string FirstName,
string LastName
)
Function PersonsByName (
FirstName As String,
LastName As String
) As SOPersons
Dim instance As IFind
Dim FirstName As String
Dim LastName As String
Dim returnValue As SOPersons
returnValue = instance.PersonsByName(FirstName,
LastName)
SOPersons^ PersonsByName(
[InAttribute] String^ FirstName,
[InAttribute] 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:
SOPersonsSOPersons a collection of persons matching Name
ExamplesPersonsByName
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.
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