I have an Outlook 2007 add-in that is trying to import ics files into Outlook.AppointmentItem objects so that I can read attributes about certain appointments. Currently I am not able to read the ics back into memory. Any suggestions on what I am doing wrong.
Outlook.Application app = new Outlook.Application();
var item = app.Session.OpenSharedItem("C:\\meeting.ics") as Outlook.AppointmentItem;
string meetingBody = item.Body; //<--*my item is null*
Thanks
In Outlook, select File > Open & Export > Import/Export. In Import and Export Wizard box, select Import an iCalendar (. ics)orvCalendar file (. vcs),and then Next.
I think the problem is due to the fact that AppointmentItem and MeetingItem are different classes so you cannot convert one to another directly. Could you try the following and check if it works?
var item = app.Session.OpenSharedItem(@"C:\meeting.ics") as Outlook.AppointmentItem;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With