View Single Post
  #8  
Old August 16th 08, 08:03 AM posted to microsoft.public.outlook.program_vba
TS Lim
external usenet poster
 
Posts: 8
Default Write data into ContactItem field

Dear Dmitry,

I tried to run it, but it does not work.

TS Lim


"Dmitry Streblechenko" wrote:

Looks fine to me. Does it work for you?
You might want to check that myItem is not Nothing first.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"TS Lim" wrote in message
...
After finding a contact item, is it possible to write data into another
field
of the item ?
In the example below, after finding the item with the CustomerID field. It
try to write data into the Spouse field. Is it the right way to do it ?
It
not, kindly advsie a way where I can write data into the fields of item
selected.

Dim myOlApp As New Outlook.Application
Dim myNamespace As Outlook.NameSpace
Dim myContacts As Outlook.Folder
Dim myItem As Outlook.ContactItem

Set myNamespace = myOlApp.GetNamespace("MAPI")
Set myContacts = myNamespace.GetDefaultFolder(olFolderContacts)
Set myItem = myContacts.Items.Find("[CustomerID] = ""ID0000001""")

myItem.Spouse = "Mrs ID000001"

myItem.Save


Your advise is appreciated.

Thank you.

TS Lim




Ads