0

I am programmatically creating Appointments through Exchange Web Services. I am setting the body of the appointment as:

appointment.Body = new MessageBody(BodyType.HTML, body);

with the body html having the following structure:

<html>
<body>
<table>
<tbody>
<tr>
<td>cell 1</td>
<td>cell 2</td>
<td>cell 3</td>
</tr>
</tbody>
</table>
</body>
</html>

When adding a border to this table, It will usually show correctly when the appointment is viewed from Outlook Web Access, but will show a table without styling when viewed from the Outlook 2013 desktop client.

I have tried the following approaches:

  1. Border property on the table element
  2. Applying a border using css
  3. Applying a border using css while collapsing borders
  4. Applying a border by setting the background of the table and individual cells while adding cellspacing
  5. Applying a border by setting the background of the individual cells, a span element within each cell, and applying padding to the cell.

Is it possible to programmatically add a table with borders to the body of an exchange appointment?

yenta
  • 1,332
  • 2
  • 11
  • 25

1 Answers1

2

Outlook uses the RTF body in Calendar Appointment so whatever your doing in HTML will get converted by the Exchange Store to RTF in Outlook. Have you tried creating the format you want in Outlook ? does it work correctly when you view that in OWA and Outlook. If so you should be able to set the RTF body instead with the correct from EWS. I'd also suggest you read EWS Managed API breaks Appointment HTML message body on update

Glen Scales
  • 20,495
  • 1
  • 20
  • 23
  • Yeah, it looks like there is a bug around this in Exchange: https://social.msdn.microsoft.com/Forums/Lync/en-US/d9535216-7181-4703-9985-4f0568fd51af/ews-12-exchange-2010-sp2sp3-appointment-message-body-gets-wrecked-on-update?forum=exchangesvrdevelopment – yenta Aug 17 '17 at 09:11
  • would you have an example of how to store an appointment as RTF? – yenta Aug 17 '17 at 09:51
  • No but you just need to write to the property outlined in those posts – Glen Scales Aug 17 '17 at 10:31
  • I have been trying to do that here: https://stackoverflow.com/questions/45731242/how-can-i-created-an-appointment-through-ews-with-a-compressed-rtf-body and the server is returning a "Content conversion failed.". Any ideas what could be missing? – yenta Aug 17 '17 at 13:47
  • You can only set one type of Body property, eg for appointment you should only use the RTF body and not set the HTML or Text body. – Glen Scales Aug 21 '17 at 05:25