View Single Post
  #1  
Old February 8th 10, 05:54 AM posted to microsoft.public.outlook.program_vba
paresh
external usenet poster
 
Posts: 66
Default Update the existing Contact item

Hi,

Could anyone please tell me how to update the Contact item? the following
code doesn't work. I want to update the fullname of existing contact item.
(all messageboxes prints the same existing fullname even after changing and
saving it)

Dim defaultContactsFolder As Outlook.MAPIFolder
Dim ocontactItem As Outlook.ContactItem
Dim ocontactItems, i
Set defaultContactsFolder =
Application.GetNamespace("MAPI").GetDefaultFolder( olFolderContacts)
Set ocontactItems = defaultContactsFolder.Items
MsgBox ocontactItems(1).FullName
ocontactItems(1).FullName = "testing"
MsgBox ocontactItems(1).FullName
ocontactItems(1).Save
MsgBox ocontactItems(1).FullName

Thanks.

Ads