问题
I'm trying to create an Appointment with an Html Body containing a Hyperlink, like it is shown in this Example:
ewsAppointment = new EwsData.Appointment(service);
ewsAppointment.Subject = "Test";
var element = new XElement("html",
new XElement("body",
new XElement("p",
new XElement("a",
new XAttribute("href", "http://www.google.it/"),
"google")),
new XElement("p", "test 2"))));
ewsAppointment.Body.BodyType = EwsData.BodyType.HTML;
ewsAppointment.Body = element.ToString();
ewsAppointment.Save(SendInvitationsMode.SendToNone);
When i open this Appointment in Outlook 2010, the Body looks as expected:
But in Outlook 2013, the formatting of the Body is lost and it looks like this:
Any idea how i can fix this Problem?
回答1:
The MS-OXCAL (section 2.2.1.38) standard document seems to suggest that appointments need to be specified in Rich Text Format. You might want to try writing the body in that, perhaps using a library like .NET RTF Writer.
I think the reason you're getting a weird change is because something in the chain is converting your HTML to RTF. This question has a lot more detail.
回答2:
The property PR_RTF_COMPRESSED is what you need. It is MAPI property supported as extended property in EWS Managed API and Exchange Web Services .NET
来源:https://stackoverflow.com/questions/33435158/ews-managed-api-appointment-with-html-body-and-outlook-2013