UserProperties and Combo-type controls

S

Simon Woods

Hi

I'm trying to access the value of a userproperty which has PossibleValues
property set to a list of values.

Is there any way I can access the value of the user property without using
the Outlook form to get hold of it. If I look in the Watch Window of this
taskitem, the hierarchy would be expressed something like

TaskItem.UserProperties(MyProperty).Value.Value(0)

What's the right way of getting hold of the value

Thanks

Simon
 
S

Simon Woods

Sue said:
theValue = theItem.UserProperties("MyProperty")

See http://www.outlookcode.com/d/propsyntax.htm

Thanks Sue ... but that's not quite it.

If I issue

Debug.Print TaskItem.UserProperties(MyProperty).name

then the property name is returned fine

If I issue

Debug.Print TaskItem.UserProperties(MyProperty).value

then I get a type-mismatch error. I have assumed that it is because it is a
list and I'm not addressing it correctly but perhaps it's something else.

Simon
 
S

Simon Woods

Simon said:
Thanks Sue ... but that's not quite it.

If I issue

Debug.Print TaskItem.UserProperties(MyProperty).name

then the property name is returned fine

If I issue

Debug.Print TaskItem.UserProperties(MyProperty).value

then I get a type-mismatch error. I have assumed that it is because
it is a list and I'm not addressing it correctly but perhaps it's
something else.

OK I'm sorted. The value property was actually a variant array. i thought I
may have been able to address it

Debug.Print TaskItem.UserProperties(MyProperty).value(0)

but I had to use an intermediate array

Dim l_asMyArray() as String

l_asMyArray = TaskItem.UserProperties(MyProperty).value
Debug.Print l_asMyArray(0)

Does that seem right?

Simon
 
S

Sue Mosher [MVP-Outlook]

Are you saying that the custom property is a keywords property? If so, see http://support.microsoft.com/kb/291117/

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

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