1

Working on a VSTO Add-In for Outlook, I need to generate, insert and replace text in an appointment body generated by Outlook 2016. Outlook encapsulate HTML tag into the RTF (MS-OXRTFEX) and I am looking for a library (free or licensed) or trick to manipulate text using this format. The text that I need to insert is in HTML or RTF format and I need to merge is with the appointment body. Below is an example of the format:

{\*\htmltag50 <body lang=en-CH link="#0563C1" vlink="#954F72" style='tab-interval:18.0pt'>}
{\*\htmltag96 <div class=WordSection1>}\htmlrtf {\htmlrtf0 
{\*\htmltag64 <p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'>}\htmlrtf {\htmlrtf0 
{\*\htmltag148 <span style='font-size:12.0pt;font-family:"Arial",sans-serif;mso-ansi-language:#2000'>}\htmlrtf {\f4 \htmlrtf0 Hello world!
{\*\htmltag244 <o:p>}
{\*\htmltag252 </o:p>}
{\*\htmltag156 </span>}\htmlrtf }\htmlrtf0 \htmlrtf\par}\htmlrtf0

{\*\htmltag72 </p>}
{\*\htmltag104 </div>}\htmlrtf }\htmlrtf0 
{\*\htmltag58 </body>}
Salim
  • 495
  • 3
  • 20

1 Answers1

3

Outlook 2016 natively supports HTML on appointments, it is just OOM does not expose it. You can try to directly set the PR_HTML binary property (DASL name http://schemas.microsoft.com/mapi/proptag/0x10130102).

Appointment.PropertyAcessor.SetProperty might not let you set that property (it blocks some properties it considers "important"), but you can try in Redemption (I am its author) and set the RDOAppointmentItem.HTMLBody property.

Also note that all stores natively supported by Outlook (OST, online Exchange, PST, IMAP, etc.) support HTML body, meaning that when an item is saved, the store provider updates all 3 body flavors (HTML, RTF, plain text) to keep them in sync.

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
  • Hi Dimitry, thanks for your feedback. Indeed, even reading the property gives me an unauthorised access exception :-/ I will try with Redemption :-) – Salim Aug 26 '19 at 04:29