![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
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. |
#2
|
|||
|
|||
![]()
Got it working. I need to set ContactItem object.
Dim defaultContactsFolder As Outlook.MAPIFolder Dim ocontactItem As Outlook.ContactItem Dim ocontactItems, i Set defaultContactsFolder = Application.GetNamespace("MAPI").GetDefaultFolder( olFolderContacts) Set ocontactItems = defaultContactsFolder.Items Set ocontactItem = ocontactItems(1) MsgBox ocontactItem.FullName ocontactItem.FullName = "testing" MsgBox ocontactItem.FullName ocontactItem.Save MsgBox ocontactItems(1).FullName Thanks. "paresh" wrote: 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. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Update Contact Item | John Tripp | Outlook and VBA | 4 | June 30th 09 03:44 PM |
Update format of existing mobile phone numbers in outlook | George | Outlook - Using Contacts | 1 | January 28th 09 01:24 PM |
How do I add and existing contact to an existing Distribution list? | Octavio[_2_] | Outlook - Using Contacts | 3 | January 24th 09 08:10 PM |
"Cannot update the appointment because the corresponding item in the folder you syncronized does not match this item" | Stephen Corliss | Outlook - General Queries | 1 | June 26th 08 12:29 AM |
How to Update Existing Items in an Outlook Folder to Use a New Cus | mattia | Outlook - Using Contacts | 1 | September 26th 06 09:28 PM |