Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing EWS Appointment Body Text

EWS creates appointment with a default "When" text in the body. Please see the image below:

enter image description here

I am wondering if it is possible to remove or hide this text some how.

Here is my code which create appointment using EWS Managed API

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP1, TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time"));
service.Credentials = new WebCredentials("ews_calendar", PASSWORD, "acme");
service.Url = new Uri("https://acme.com/EWS/Exchange.asmx");

Appointment newAppointment = new Appointment(service);
newAppointment.Subject = "Test Subject";
newAppointment.Body = "Test Body";
newAppointment.Start = new DateTime(2012, 07, 19, 17, 00, 0);
newAppointment.End = newAppointment.Start.AddMinutes(30);
newAppointment.RequiredAttendees.Add("[email protected]");

// create new appointment
newAppointment.Save(SendInvitationsMode.SendToAllAndSaveCopy);
like image 887
Firoz Ansari Avatar asked Jul 19 '12 20:07

Firoz Ansari


1 Answers

I created test appointments using EWS in the same manor above and explored the properties of the objects using MFCMAPI and EWS Editor. Via MAPI the when-text is stored in the PidTagHtml property. Via EWS the when-text is stored in the Body property. The when-text exists on the received copy, but not on the original in the sender's calendar folder.

Based on this it appears the when-text is inserted to the body at send time. If you remove the line

newAppointment.RequiredAttendees.Add("[email protected]");

then an appointment is created instead of a meeting. In that case the when-text doesn't come into play.

  1. I'm pretty sure there's no way to get around this behavior, except for going into the recipient's mailbox and removing the text on the received copy.
  2. Even if there was a better workaround, I wouldn't recommend doing it because both Outlook and OWA create meetings in the same manor.
like image 184
Elijah W. Gagne Avatar answered Oct 02 '22 15:10

Elijah W. Gagne