Solved

Collaboration Data Objects

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Sometimes Outlook might have problems sending a message. There may be various causes- corrupted PST, AV scanner etc. The message, instead of going to the Sent Items folder, sits in the Outbox indefinitely. To remove it you can use a free tool cal…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

758 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now