ContactCollection object


Methods

Add Add a quick contact.
Remove Remove contact.
Sort Sort contacts by name.
Update Update contacts.

Properties

Count Contact count.
Items Get/Set specified Contact object.

Remarks

ContactCollection object is a collection made up of Contact objects. It can be used to manage contacts in EAS. ContactCollection object inherited from Domain object can only be changed by domain administrator.

Usage Example

Dim server, user, password, requestAddr
server = "localhost"
user = "hunter@emailarchitect.net"
password = "mypassword"
requestAddr = "192.168.0.1"

Dim oSvr
Set oSvr = CreateObject("EmailArchitectObjects.ServerRoot")
r = oSvr.Connect( server, user, password, 0, requestAddr )
If r <> 0 Then
  WScript.Echo( "connect server failed!" )
  WScript.Quit
End If

Dim oDomains, oDomain
Set oDomains = oSvr.DomainCollection
Set oDomain = oDomains.Items(CStr(oSvr.Domain)) 

Dim oContacts, oContact
Set oContacts = oDomain.ContactCollection
Dim i, nCount
nCount = oContacts.Count
'enumerates all contacts in global address book
For i = 0 To nCount-1
  Set oContact = oContacts.Items(CLng(i))
  WScript.Echo( oContact.GetItem("quickname"))
Next

Dim oUsers, oUser
Set oUsers = oDomain.UserCollection
Set oUser = oUsers.Items(CStr(oSvr.User))

Set oContacts = oUser.ContactCollection
nCount = oContacts.Count
'enumerates all contacts in user address book
For i = 0 To nCount-1
  Set oContact = oContacts.Items(CLng(i))
  WScript.Echo( oContact.GetItem("quickname"))
Next