Hello
I have some VB. NET code that I can use to add a new contact to my
Google Contacts in Gmail.
I can add things like Name, Email, Phone, Address.
I would like to add the user to a Group called "Newsletter" that I
have created. This is where I run into the problem. No matter what I
try I just can't get this to work. I am trying to use the
GroupMembership class. Is there a way to do this???
I have this in a simple ASPX page with 2 text boxes, 1 for name, the
other for email.
Here is my code so far...
Dim conserv As New ContactsService("exampleCo-exampleApp-1")
Dim newEntry As New ContactEntry
Dim userMail As New EMail(EmailBox.Text)
Dim gm As New GroupMembership 'does not work!!!
conserv.setUserCredentials("my_gmail_address",
"my_gmail_password")
gm.Value = "Newsletter" 'does not work!!!
newEntry.Title.Text = NameBox.Text 'add name to new entry
userMail.Primary = True 'make that the primary email
userMail.Rel = ContactsRelationships.IsWork
newEntry.Emails.Add(userMail)
newEntry.GroupMembership.Add(gm) 'DOes not work!!!
Dim urifeed As New Uri(ContactsQuery.CreateContactsUri
("default"))
conserv.Insert(urifeed, newEntry) 'cannot get past this line
if I try to add entry to a group
Any help would be greatly appreciated.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Contacts API" 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://groups.google.com/group/google-contacts-api?hl=en
-~----------~----~----~----~------~----~------~--~---