![]() |
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
|
|||
|
|||
![]()
Outlook 2003. I have created a custom contact form and added two
"user-defined" fields called "Employment Date" and "Spouse Birthday." How may I programmatically reference these fields in a contact? For instance, in the following code, how would I reference the fields? Dim olApp As New Outlook.Application Dim olNS As Outlook.Namespace Dim ctFolder As Outlook.MAPIFolder Dim ctFolderItems As Outlook.Items Dim iterateCtItems As Integer Dim countCtItems As Integer Dim IC As Integer Dim Criteria As String Dim itm As Object On Error Resume Next Set olNS = olApp.GetNamespace("MAPI") Set ctFolder = olNS.Folders("Public Folders") Set ctFolder = ctFolder.Folders("All Public Folders") Set ctFolder = ctFolder.Folders("Good News Contacts") Set ctFolderItems = ctFolder.Items countCtItems = ctFolderItems.Count '************************************************* ******* For Each itm In ctFolderItems Debug.Print itm.FullName 'No problem for a standard contact field Debug.Print itm.????????? 'What do I put for a user-defined field? Next -- Dr. Doug Pruiett Good News Jail & Prison Ministry www.goodnewsjail.org |
Ads |
#2
|
|||
|
|||
![]()
Use the UserProperties collection and UserProperty objects:
Dim objUPS As UserProperties Dim objUP As UserProperty Set objUPS = itm.UserProperties Set objUP = objUPS.Item("MyCustomFieldName") objUP.Value = "My test value" -- Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Chaplain Doug" wrote: Outlook 2003. I have created a custom contact form and added two "user-defined" fields called "Employment Date" and "Spouse Birthday." How may I programmatically reference these fields in a contact? For instance, in the following code, how would I reference the fields? Dim olApp As New Outlook.Application Dim olNS As Outlook.Namespace Dim ctFolder As Outlook.MAPIFolder Dim ctFolderItems As Outlook.Items Dim iterateCtItems As Integer Dim countCtItems As Integer Dim IC As Integer Dim Criteria As String Dim itm As Object On Error Resume Next Set olNS = olApp.GetNamespace("MAPI") Set ctFolder = olNS.Folders("Public Folders") Set ctFolder = ctFolder.Folders("All Public Folders") Set ctFolder = ctFolder.Folders("Good News Contacts") Set ctFolderItems = ctFolder.Items countCtItems = ctFolderItems.Count '************************************************* ******* For Each itm In ctFolderItems Debug.Print itm.FullName 'No problem for a standard contact field Debug.Print itm.????????? 'What do I put for a user-defined field? Next -- Dr. Doug Pruiett Good News Jail & Prison Ministry www.goodnewsjail.org |
#3
|
|||
|
|||
![]()
Thank you Eric.
-- Dr. Doug Pruiett Good News Jail & Prison Ministry www.goodnewsjail.org "Eric Legault [MVP - Outlook]" wrote: Use the UserProperties collection and UserProperty objects: Dim objUPS As UserProperties Dim objUP As UserProperty Set objUPS = itm.UserProperties Set objUP = objUPS.Item("MyCustomFieldName") objUP.Value = "My test value" -- Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Chaplain Doug" wrote: Outlook 2003. I have created a custom contact form and added two "user-defined" fields called "Employment Date" and "Spouse Birthday." How may I programmatically reference these fields in a contact? For instance, in the following code, how would I reference the fields? Dim olApp As New Outlook.Application Dim olNS As Outlook.Namespace Dim ctFolder As Outlook.MAPIFolder Dim ctFolderItems As Outlook.Items Dim iterateCtItems As Integer Dim countCtItems As Integer Dim IC As Integer Dim Criteria As String Dim itm As Object On Error Resume Next Set olNS = olApp.GetNamespace("MAPI") Set ctFolder = olNS.Folders("Public Folders") Set ctFolder = ctFolder.Folders("All Public Folders") Set ctFolder = ctFolder.Folders("Good News Contacts") Set ctFolderItems = ctFolder.Items countCtItems = ctFolderItems.Count '************************************************* ******* For Each itm In ctFolderItems Debug.Print itm.FullName 'No problem for a standard contact field Debug.Print itm.????????? 'What do I put for a user-defined field? Next -- Dr. Doug Pruiett Good News Jail & Prison Ministry www.goodnewsjail.org |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Changing order of user defined fields | Amy | Outlook - Using Forms | 2 | March 2nd 06 05:53 PM |
Export & Import of outlook 2003 "User Defined Fields" at folder le | Kamele0n | Outlook - Using Contacts | 1 | February 25th 06 05:34 PM |
user defined fields | Karl-H. Engesser | Outlook - Using Contacts | 1 | February 9th 06 03:33 PM |
How do I rename user defined field names? | Sue Mosher [MVP-Outlook] | Outlook - Using Contacts | 1 | January 19th 06 04:13 AM |
Referencing a User-Defined Field | Chaplain Doug | Outlook - Using Forms | 1 | January 13th 06 04:54 PM |