Outlook 2010 Retrieving and restricting appointments programmatically causing recurrences to be incl

Posted by Mike Dearing on Stack Overflow See other posts from Stack Overflow or by Mike Dearing
Published on 2010-04-23T22:51:58Z Indexed on 2010/04/23 22:53 UTC
Read the original article Hit count: 363

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;

© Stack Overflow or respective owner

Related posts about outlook-2010

Related posts about c#