PC Review


Reply
Thread Tools Rate Thread

Accessing user defined field in Contact

 
 
New Member
Join Date: May 2011
Posts: 1
 
      13th May 2011
Hi,

I'm reasonably new to Outlook coding so apologies if I don't explain this problem very well.

My company has included a number of custom fields to employee contacts in the GAL (emp ID, grade, division etc). As part of a user form, I want to be able to bring up the GAL, select the required employee contact and then have a specific custom field (emp ID) brought back.

I was able to achieve this using CDO 1.21, however this only works on 50% of machines for some reason, and I have since found out it's a discontinued technology anyway. So I want to recreate it using the Object model instead.

I got as far as the code below;

Code:
Private Sub CommandButton2_Click()
 Dim oDialog As SelectNamesDialog
    Dim oAL As AddressList
    Dim oContacts As Folder
    Dim Employee As Object
    Dim EmpID As String
 
    Set oDialog = Application.Session.GetSelectNamesDialog
      With oDialog
        'Initialize the dialog box with the address list representing the Contacts folder
        .InitialAddressList = oAL
        .ShowOnlyInitialAddressList = True
        If .Display Then
            'Recipients Resolved
            'Access Recipients using oDialog.Recipients
        Set Employee = oDialog.Recipients.Item(1)
I can't work out though how to access the custom fields. In CDO i could access it via the below method:

Code:
empnovalue = Recipients.Item(1).AddressEntry.Fields(31)
However the object model doesn't appear to have the 'Fields' option under 'AddressEntry'.

Can someone please help??
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exporting User defined Contact Field =?Utf-8?B?S2VpdGg=?= Microsoft Outlook Contacts 25 15th Jul 2009 06:25 PM
Re: How to export user-defined field from contact to business contact Raul Microsoft Outlook BCM 0 1st Dec 2006 04:04 AM
how do i import from a csv file to a user defined contact field i. =?Utf-8?B?RCBCcmV0?= Microsoft Outlook Contacts 1 15th Jan 2005 04:06 PM
How do I get a user defined date field in Contact to show up on C. =?Utf-8?B?bXdmdXNz?= Microsoft Outlook Calendar 1 12th Nov 2004 03:13 AM
Customizing the default form Contact (with user-defined field) ? Anthony F. Microsoft Outlook VBA Programming 1 17th Feb 2004 04:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:49 PM.