views:

324

answers:

0

I wrote a winforms app that uses Microsoft.Office.Interop.Outlook to retrieve and restrict appointments based upon the date range entered by a user.

This worked fine with Outlook 2007 installed, however now that some users have updated to Outlook 2010 the appointment retrieval is pulling back incorrect appointments along with the correct ones falling within the specified date range. The additional incorrect appointments being retrieved always appear to be recurring appointments.

I was wondering if this is a known bug and if so what exactly is happening that is causing these additional recurring appointments to come in? I'd rather not have to throw in a workaround where I step through the items after they have been restricted and remove the extra ones, when this functionality works fine with 2007.

Note: I've not recompiled or updated any code when experiencing this issue, just running the old program.

This is the spot in my code where appointments are being restricted. This is similar to the way advised in the following msdn link: http://msdn.microsoft.com/en-us/library/bb611267.aspx

Microsoft.Office.Interop.Outlook.Items outlookItems = 
    outlookMapiFolder.Items.Restrict(
        "[Start] >= '" + outlookImport.startDay.ToString("g") +
        "' AND [Start] <= '" + outlookImport.endDay.ToString("g") + "'");

outlookItems.Sort("[Start]", Type.Missing);
outlookItems.IncludeRecurrences = true;

To clarify: I realize that this should be including recurrences, but it shouldn't be including recurrences out of the specified date range, and it didn't when outlook 2007 was installed.