Search code examples
c#outlookcalendarappointment

Display outlook appointment calendar


I have a C# app which creates an appointment (oAppoint) and moves it to a different calendar (an exchange one, not mine). When I use the func() display(), it displays the oAppoint object that is in my calendar. How do I display the appointment on the calendar I moved it to?

oAppoint.Move(newCalFolder);
oAppoint.Save();
oAppoint.Display(); // display the appointment item at the calendar I moved it to (? how ?)

Solution

  • The Move method will return an object referring to the item that was moved, so:

    Outlook.AppointmentItem movedItem = (Outlook.AppointmentItem)oAppoint.Move(newCalFolder);
    movedItem.Display();