Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Collaboration Data Objects

Posted on 2009-07-08
4
603 Views
Last Modified: 2012-05-07
Hi,
I'm using CDO Iin VBA to loop though properties on a large number of Outlook Contact items. I can access the inbuilt outlook properties OK, but  don't know how to access user defined props. If I reference an inbuilt Outlook contact item property (e.g. the 'profession' field) with:
objCDO.Fields(CdoPR_PROFESSION)
How do I reference a user defined contact item property (e.g. 'MyTestField1')?
Thanks
Sub LoopThroughContactItems()
    Dim objApp As Outlook.Application
    Dim objItem As Object
    Dim objCDO As MAPI.Message
    Set objApp = CreateObject("Outlook.Application")
    Set objFolder = objApp.ActiveExplorer.CurrentFolder
    If Not objItem Is Nothing Then
        If g_CDOSession Is Nothing Then
            Call DoCDOLogon
        End If
    End If
    For Each objItem In objFolder.Items
        Set objCDO = GetCDOItemFromOL(objItem)
        If Not objCDO Is Nothing Then
            objCDO.Fields(CdoPR_PROFESSION) = ""
           ACCESS USER DEFINED FIELD 'MYTESTFIELD1' HERE AND UPDATE AS ABOVE
            objCDO.Update

Open in new window

0
Comment
Question by:JP53
  • 3
4 Comments
 
LVL 46

Expert Comment

by:tbsgadi
ID: 24802632
Hi JP53,

Have a look at the following:
http://www.cdolive.com/cdo10.htm
The user defined fields information are stored in binary data. There is no documented way to access and modify them programmatically with CDO 1.2x.


Gary
0
 

Author Comment

by:JP53
ID: 24802858
Thanks Gary,

Do you have another link. The site above seems dead. Do you also know if Redemption would be a work around? I just need something that will alow me VBA code access to a large number of contacts to update certain user defined properties on contact items. Using normal VBA is creating massive memory leaks and crashing the app.

J

0
 
LVL 46

Expert Comment

by:tbsgadi
ID: 24802869
It worked 10 mins ago!!!
0
 
LVL 46

Accepted Solution

by:
tbsgadi earned 500 total points
ID: 24802923
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question