out of memory while running custom form

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
 
K

Ken Slovak - [MVP - Outlook]

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.
 

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