Exporting Custom Contact Fields through VBA code

C

Chris W

I have some code that will take custom fields from a
contact item and export that information into Excel.
However, if the custom field exists at the Form level,
then I cannot use the Item.UserProperties arguement to
find that field (OCCUPANTID for example). This is my code
so far:

If item.UserProperties("OCCUPANTID") <> "" Then
range.Value = item.UserProperties("OCCUPANTID")
End If

Does anyone know of a way to use the UserProperties to get
to a Form level field?

Thanks,
Chris
 
S

Sue Mosher [MVP]

If you're getting an error, that would indicate that the property is *not*
in fact defined at the form level and would need to be added before a value
for it could be set (which means there's no value to export for that item).
 

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