I have a little problem.
i need to make a program to maintain Active directory and Exchange 2000 accounts
and my Fox traslation of original Microsoft VB sample do not works.
One user can have many e-mail address, and that addresses are passed with an
array.
The problem is assigning an array to a property of a object,
when i use the syntax (@array) to pass the address fox returns a syntax error,
and if i write property=array only updates one value, not all the address contained
on the array.
the code works well, but only updates one e-mail address.
I'm testing with COMARRAY function but with no result.
some ideas?
Thanks in advance
ORIGINAL VB code
================
Visual Basic
Sub SetProxyAddress(recipname As String, _
DomainName As String)
'DomainName is something like "DC=MYDOMAIN3,DC=microsoft,DC=com"
'recipname is something like "jamessmith"
Dim objPerson As New CDO.Person
Dim objMailRecip As CDOEXM.IMailRecipient
Dim i
objPerson.DataSource.Open "LDAP://CN=" + recipname + _
",CN=users," + DomainName
'Capitalized proxy type for proxies(1) makes it the primary (reply) address.
'the others are receive only.
Dim proxies(3) As Variant
proxies(0) = "smtp:
user@secondarymailproxy.microsoft.com"
proxies(1) = "SMTP:
user@primarymailproxy.microsoft.com"
proxies(2) = "X400:c=us;a= ;p=Domain;o=First Organization;s=user;"
Set objMailRecip = objPerson
objMailRecip.ProxyAddresses = proxies
'look at the results
Debug.Print Chr(13) + Chr(13) + Chr(13) + Chr(13) + Chr(13) 'add some space
For i = LBound(objMailRecip.ProxyAddresses) To UBound(objMailRecip.ProxyAddresses)
Debug.Print objMailRecip.ProxyAddresses(i)
Next
objPerson.DataSource.Save
MsgBox "Proxy addresses for " + recipname + " set successfully"
End Sub
================
My VFP Traslation
================
DIMENSION proxies(3)
proxies(1)="smtp:
uno@uno.com"
proxies(2)="SMTP:
dos@dos.com"
proxies(3)="smtp:
tres@tres.com"
lcString = "smtp:
uno@uno.com"+"SMTP:
dos@dos.com"+"smtp:
tres@tres.com"
objPerson= NEWOBJECT("CDO.person")
objPerson.DataSource.Open("LDAP://CN=AA0prueba4,CN=Users,DC=redcam,DC=es")
objPerson.EmailAddresses = (@proxies) && Here is the problem
objPerson.DataSource.Save
================