Solved

Collaboration Data Objects

Posted on 2009-07-08
4
630 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
[X]
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
  • 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying 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

Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
If you troubleshoot Outlook for clients, you may want to know a bit more about the OST file before doing your next job. IMAP can cause a lot of drama if removed in the accounts without backing up.
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…
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…

717 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