using Restrict with Redemption: Invalid Parameter

S

srallen

I have the following code which is trying to limit the MAPITable to
items recd from 2004-2005.
The call the Restrict continues to give me Invalid parameter. I've
tried all manners of writing out the date params still to no avail.

Can anyone offer any advice?

void searchItems(RDOFolder source)
{
const int PR_MESSAGE_DELIVERY_TIME = 0x0E060040;
const int PR_SENDER_NAME = 0x0C1A001E;

MAPITable mytable = source.Items.MAPITable;
RestrictionAnd rest;
RestrictionProperty r1, r2;
mytable.Filter.Clear();
rest =
(RestrictionAnd)mytable.Filter.SetKind(RestrictionKind.RES_AND);
r1 =
(RestrictionProperty)rest.Add(RestrictionKind.RES_PROPERTY);
r1.relop = PropsRelop.RELOP_GE;
r1.ulPropTag = PR_MESSAGE_DELIVERY_TIME;
r1.lpProp = "\"January 1, 2004 12:00 AM\"";
r2 =
(RestrictionProperty)rest.Add(RestrictionKind.RES_PROPERTY);
r2.relop = PropsRelop.RELOP_LT;
r2.ulPropTag = PR_MESSAGE_DELIVERY_TIME;
r2.lpProp = "\"January 1, 2005 12:00 AM\"";
mytable.Filter.Restrict();
 
Top