Get/Set specified Contact object.
Data Type: Object
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 oUsers, oUser
Set oUsers = oDomain.UserCollection
Set oUser = oUsers.Items(CStr(oSvr.User))
Dim oContacts, oContact
Set oContacts = oUser.ContactCollection
'search contact which has email address "test@emailarchitect.net" and change it
Dim i, nCount
nCount = oContacts.Count
For i = 0 To nCount-1
Set oContact = oContacts.Items(CLng(i))
If LCase(oContact.GetItem("email")) = "test@emailarchitect.net" Then
Exit For
End If
Set oContact = Nothing
Next
If oContact Is Nothing Then
WScript.Echo "no contact found"
WScript.Quit
End If
Dim cid
cid = oContact.GetItem("cid")
oContact.PutItem "email", "tester@emailarchitect"
oContacts.Items(CStr(cid)) = oContact
oContacts.Update
See Also