Solved

Collaboration Data Objects

Posted on 2009-07-08
4
590 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Outlook Free & Paid Tools
Are you unable to connect or configure Hotmail email account in Microsoft Outlook 2010, 2007? Or Outlook.com emails are not downloading to Outlook? Lets’ see the problem and resolve Outlook Connector error syncing folder hierarchy (0x8004102A).
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

770 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