Alain,
Thanks for the follow-up.
I am doing this the long way. I grab all contacts from the Export account
and put them into a List Array then iterate through each row of the array
and test each piece of data, appending anything that has something in it to
a new ContactEntry, as follows:
On Error GoTo ErrorHandling
Dim rs As New RequestSettings("domain.com", ExportNameTextBox.Text &
"@domain.com", ExportPasswordTextBox.Text)
System.Net.ServicePointManager.Expect100Continue = False
rs.AutoPaging = True
Dim cr As New ContactsRequest(rs)
Dim f As Feed(Of Contact) = cr.GetContacts()
Dim varContacts As List(Of Google.Contacts.Contact) =
f.Entries.ToList
Dim feedUri As New Uri(ContactsQuery.CreateContactsUri("default"))
Dim service As New ContactsService("domain.com")
service.setUserCredentials(ImportNameTextBox.Text & "@domain.com",
ImportPasswordTextBox.Text)
For x = 0 To varContacts.Count - 1
Dim newEntry As New ContactEntry()
Dim name As New Name()
name = New Name()
name.FullName = varContacts(x).Name.FullName
newEntry.Name = name
For varCount = 0 To varContacts(x).Phonenumbers.Count - 1
If varContacts(x).Phonenumbers(varCount).Home Then
Dim HomePhone As New PhoneNumber()
HomePhone = New PhoneNumber
HomePhone.Value =
varContacts(x).Phonenumbers(varCount).Value
HomePhone.Rel = ContactsRelationships.IsHome
newEntry.Phonenumbers.Add(HomePhone)
End If
Next
{REPEAT FOR WORK PHONE AND OTHER PHONE}
newEntry.Content.Content = varContacts(x).Content
Dim createdEntry As ContactEntry =
DirectCast(service.Insert(feedUri, newEntry), ContactEntry)
Next
Is there an easier way to, for instance, copy a whole row from the arry into
the new ContactEntry rather than looking into each field?
Thanks.
--
You received this message because you are subscribed to the Google
Groups "Google Contacts, Shared Contacts and User Profiles APIs" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://code.google.com/apis/contacts/community/forum.html