A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Write data into ContactItem field



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old August 16th 08, 04:31 AM posted to microsoft.public.outlook.program_vba
TS Lim
external usenet poster
 
Posts: 8
Default Write data into ContactItem field

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
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Field data available to all folders Jodi Outlook - Using Forms 3 October 4th 07 12:32 PM
How to write to 'Categories' field using VBA [email protected] Outlook - General Queries 2 September 26th 07 09:15 AM
ContactItem Write event not getting called Dave Add-ins for Outlook 1 April 19th 07 06:44 AM
Copying Data form user field to custom field [email protected] Outlook - Using Contacts 1 September 4th 06 06:32 PM
How do I copy data from one field to another? reiner Outlook - Using Contacts 3 February 19th 06 07:56 PM


All times are GMT +1. The time now is 04:26 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.