out of memory while running custom form

  • Thread starter Thread starter Long Nguyen
  • Start date Start date
L

Long Nguyen

(Outlook 2002 sp3)

I have a vb code in a custom form that run a For ... Next loop to go through
form items in a public folder and checking for a Start Date field in the
item that falls between a nominated period.

Something like -

For I to NumItems
If DateValue(MyItem(I).UserProperties("StartDate") > FromDate AND _
DateValue(MyItem(I).UserProperties("StartDate") < ToDate Then
...
End If
Next

However when running the code against a folder having some 70 forms I got an
"out of memory or sytsem resources" message.

Anyway to change the code to avoid the problem?

Thanks
Long
 
Try using a restriction on the Items collection of the folder. Look at the
Object Browser help on Restrict, there's an example of using comparisons on
date fields and you can use user properties if they are in the folder and
not just the items.
 
Back
Top