EWS creates appointment with a default "When" text in the body. Please see the image below:
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);
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.
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