Attribute VB_Name = "Module1"
Sub main()
    Dim oPerson As New CDO.Person
    Dim strURL As String
   
    'On Error Resume Next
    
    strURL = "LDAP://cn=user1,cn=Users,dc=ywd,dc=extest,dc=microsoft,dc=com"
    oPerson.DataSource.Open strURL, , adModeReadWrite
    
    'For i = 1 To oPerson.Fields.Count
    '    Debug.Print oPerson.Fields(i).Name & " = " & oPerson.Fields(i).Value
    'Next
    Debug.Print oPerson.Fields("mailnickname").Value
    Stop
    
    oPerson.Fields("mailnickname") = "Yamin"
    oPerson.Fields.Update
    oPerson.DataSource.save
    Set oPerson = Nothing
    
    Set oPerson = New CDO.Person
    oPerson.DataSource.Open strURL, , adModeReadWrite
    Debug.Print oPerson.Fields("mailnickname").Value
        
    strURL = "file://./backofficestorage/ywd.extest.microsoft.com/MBX/user2/contacts/test.eml"
    oPerson.DataSource.SaveTo strURL, , adModeReadWrite, adCreateOverwrite
    
    Set oPerson = Nothing
End Sub
