Click or drag to resize

IContactGetRelations Method

Get all relations with connection to this contact

Namespace:  SuperOffice.COM.SuperOfficeDB
Assembly:  SuperOfficeDB.Interop (in SuperOfficeDB.Interop.dll) Version: 8.0.0.0
Syntax
SORelations GetRelations()

Return Value

Type: SORelations
SORelations a collection of SORelation objects
Examples

GetRelations

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

VB
dim objso
set objso = CreateObject("superoffice.application")
If not (objSO is nothing) Then
    set sorelations = objso.currentcontact.getrelations
    set relation = sorelations.getfirst
    while not sorelations.eof
        if relation.sourcetable = 5 then 'the source of the relation  is a company
            set cont = relation.sourcerecord
            source = cont.name
        else 'the  source of the relation is a person, and source record would be 6
            set pers = relation.sourcerecord
            source = pers.firstname  & " " & pers.lastname & " from company " & pers.contact.name
        end if
        if relation.targettable = 5 then
            set cont = relation.targetrecord
            target = cont.name
        else
            set pers = relation.targetrecord
            target = pers.firstname & " " & pers.lastname & " from company " & pers.contact.name
        end if
        msg = source & " " & relation.activetext  & " " & target & vbcrlf
        msgbox  msg,,"relations:"
        set relation = sorelations.getnext
    wend
else
    msgbox  "unable to connect to database"
end if
set objso  = nothing

See Also