Tuesday, January 25, 2011

RDOItems GetActivitiesForTimeRange() function in outlook addin development

GetActivitiesForTimeRange is a method that returns calendar meeting items between the specified date range in C#.Net API. Here is a sample you can follow for reference.

RDOAppointmentItem mitem = null;
RDOSessionClass session = new RDOSessionClass();
               session.Logon("", "", false, false, null, false);
               RDOFolder2 folder = (RDOFolder2)session.

GetDefaultFolder( rdoDefaultFolders. olFolderCalendar);
               RDOItems items = folder.
GetActivitiesForTimeRange( StartDate.Date, StartDate.Date.AddDays(1), true);
               foreach (object item in items)
               {
                   mitem = item as RDOAppointmentItem;
          //You can also check whether the item is a recurring item or not.
                   if (mitem.IsRecurring)
                   {
                       //You can do whatever you want.
                   }
               }

No comments:

Post a Comment