Userproperties missing

  • Thread starter Thread starter Peter Winkler
  • Start date Start date
P

Peter Winkler

Okay,

So I'm ignorant and getting old. I had this problem about 5 years ago,
and I just can't remember what was going on.

We have a public folder with task items. We have a custom form, with
some code, that is trying to find the maximum number of a user
property.

And in the code to iterate over all items (there are currently 502 in
the folder), at item 250, all of a sudden theItem.UserProperties.Count
generates an Unknown Exception.

Fire up visual studio 2003.net and inspect the item in the watch
window. Here's what the item reports (with my comments):

TypeName(theItem) = "TaskItem" <looks ok, it should be>
theItem.Subject = "Task # 365" <looks ok, that's what we want>
theItem.UserProperties.Count Unable to evaluate the expression
theItem.ActualWork Unable to evaluate the expression

What's going on here ? Quick let's take a look at item # 249 - the
previous one. And that item has all the properties (including 42
Userproperties).

This always happens at item #250 in this folder (always the same item)
- almost like it's not a TaskItem (or an outlookItem at all).

BTW, iterating over the items with VB works fine. They all have
UserProperties.

And displaying the item in a different view, shows it to have the
UserProperties - it's just when running the vbscript in the form that
this occurs.
 
And the clues keep coming in... the Userproperty in question is a form
defined one (the mistake !) - see
http://support.microsoft.com/?kbid=183352

As form defined user property it does not necessarily exist on all
items. But that can easily be fixed through a little creative VB
programming - not in VBScript though, because apparently those items
don't have userproperties at all - hence anything of the form
item.userproperties will cause a script error.
 
Back
Top