views:

45

answers:

0

I'm using a CalendarItemType view to retrieve calendar items. The only items I care about are those that I've created and I know that they are all weekly recurring items. I'm able to get each individual occurrence and, from any one of them the recurring master item, but I'd like to narrow the scope of my search to just those items that would match my pattern.

I've trying using the Restriction property on the FindItemType to specify a NotEqualTo restriction with a null constant for calenderRecurrenceId. This caused my request to time out. So far I've been unable to load the recurrences with the FindItemType at all and need to use a subsequent GetItemType call when I find an event that is an occurence in a recurring series.

Here's the code that I'm starting with. The code needs to work with both Exchange 2007 and Exchange 2010.

    var findItemRequest = new FindItemType();

    findItemRequest.ParentFolderIds = new DistinguishedFolderIdType[]
    {
        new DistinguishedFolderIdType()
    };

    ((DistinguishedFolderIdType)findItemequest.ParentFolderIds[0]).Id = DistinguishedFolderIdNameType.calendar;
    findItemRequest.Traversal = ItemQueryTraversalType.Shallow;

    var itemShapeDefinition = new ItemResponseShapeType(
    {
        BaseShape = DefaultShapeNamesType.AllProperties;
    }

    findItemRequest.Item = calenderView;
    findItemRequest.ItemShape = itemShapeDefinition;

    var findItemResponse = this.esb.FindItem( findItemRequest );

Also, if you know of any good source of examples (beyond the ones in MSDN), I'd welcome them. I'm picking up someone else's code in an emergency and trying to learn Exchange Web Services on the fly.