Link to home
Start Free TrialLog in
Avatar of JP53
JP53

asked on

Collaboration Data Objects

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

Avatar of tbsgadi
tbsgadi
Flag of Israel image

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
Avatar of JP53
JP53

ASKER

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

It worked 10 mins ago!!!
ASKER CERTIFIED SOLUTION
Avatar of tbsgadi
tbsgadi
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial