Powered by Blogger.

Sunday, February 23, 2014

How to read recurrance Pattern of a outlook meeting using redemption using c#.net?



In this post we will discuss about How to read recurrance Pattern of a outlook meeting using redemption using c#.net? Also you can check out my previous posts on:

- Data files and Log files in sql server 2008

- Get only alphabet characters from string in asp.net

- How to display serial number automatically in GridView in asp.net?

Its really very difficult to read all the occurrences of a recurring meeting using any of the APIs available in the market. Sometimes if you will read through outlook apis then it will not give the correct time if user send the meeting from different time zone. Hope the below way some how help you to read the recurrence item.

        RDOSessionClass session = new RDOSessionClass();
                session.Logon("", "", false, false, null, false);
                RDOFolder folder = session.GetDefaultFolder(rdoDefaultFolders.olFolderCalendar);
                RDOItems items = folder.Items;
   foreach (object item in items)
                {
                    if (item is RDOAppointmentItem)
                    {
  RDOAppointmentItem rdoItem = item as RDOAppointmentItem;
  RDORecurrencePattern recPatt = rdoItem.GetRecurrencePattern();

                        int j = 1;
                        for (j = 1; j <= recPatt.Occurrences; j++)
                        {
//This loop will run for the no of ocuurance the recurring meeting contains.
                            RDOAppointmentItem rdoItem1 = null;
                            try
                            {
                                rdoItem1 = (RDOAppointmentItem)recPatt.GetOccurence(j);
                           
                            }
                            catch (System.Exception ex)
                            {
                                MessageBox.Show(ex.InnerException.ToString());
                            }
                        }
}
}

If there will be no end date is selected in the recurring Pattern then the Occurrences count returns 0. But the most important thing is that it also gives the perfect time in case if user changes the timezone. 





0 comments

Post a Comment