Hello, If the contact does not belong to a custom group, you should be able to use the same entry and post it directly to the new account without having to copy each fields. Also, when creating contacts, I would advise you to use batch requests so that you can create 50 contacts with one request at a time which should save you a lot of time.
Best, Alain On Wed, May 25, 2011 at 10:43 AM, CleanDen <[email protected]> wrote: > 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 > -- Alain Vongsouvanh -- 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
