How do I access user-defined fields in one-off'd contact items?

R

Roman Spanner

I've tried using the following two methods;

I've tried using the following two bits of code, but they don't work;

varValue = cdoMessage.Fields(strField).Value ' using CDO

and

varValue = outContactItem.UserProperties(strField).Value ' using the
Outlook object model

Can you tell me what I'm doing wrong? Is there another method/property I
should be using?

Should I be able to extract the values from user-defined fields in a
one-offed item?

Many thanks in advance,

Philip Street
 
S

Sue Mosher [MVP-Outlook]

varValue = outContactItem.UserProperties(strField) should work fine. If it
doesn't, display the item in form design view and take a look at the All
Fields tab to see if that field (check for typos!!!) actually exists in the
item. If it has never held data, it may not.
 
P

Philip Street

Sue,

I've now displayed the All Fields tab on my custom form and have found the
following.

I've opened one of the items and found that some of my user-defined fields
are displayed in the "user-defined fields in item". One of those fields
("Contract Value") has a value ("£12,000.00"), in this view, but when I
display the "user-defined fields in folder" view, the same field is listed
but without a value. Do you know the cause of this behaviour, and how it
might be fixed?

You recall that I mentioned before that some of the items an a Post icon
next to them rather than a Contact icon, in the Phone List view. Well, I've
just created a new contact and this also has a Post icon. This appears to
happen for all new contacts created with the form. Any ideas about this as
well?

As ever, you assistance is much appreciated. I didn't realise custom Outlook
solutions could be so tortuous!

Cheers,

Phil

p.s. I've ran the "clean one-off items" code you've suggested against all
the contacts, but am not sure whether it worked or not - how do I check?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top