Creating a ScheduleView that synchronizes with Outlook

1 posts, 0 answers
  1. Minh
    Minh avatar
    43 posts
    Member since:
    May 2014

    Posted 16 May 2016 Link to this post


    At the moment, upon loading my usercontrol, I programatically load all my calendar events. I export my outlook calendar folder then import it into the schedule view. I'm wondering what is the best approach to integrate with outlook? I created methods to trigger OnAppointmentDelete and OnAppointmentCreate, such that it'll update outlook. But is this the ideal solution? 


            private void LoadOutlook()
                    var outlook = new ApplicationClass();
                    var OutlookNS = outlook.GetNamespace("MAPI");

                    MAPIFolder f = OutlookNS.GetDefaultFolder(OlDefaultFolders.olFolderCalendar);

                    CalendarSharing cs = f.GetCalendarExporter();
                    cs.CalendarDetail = OlCalendarDetail.olFullDetails;
                    cs.StartDate = new DateTime(2011, 11, 1);
                    cs.EndDate = new DateTime(2018, 12, 31);
                    var tempPath = Path.GetTempPath();
                    var tempCalendar = tempPath + "cal.ics";
                    using (TextReader txtReader = new StreamReader(tempCalendar))

Back to Top