EWS managed API - Appointment with Html Body and Outlook 2013

人走茶凉 提交于 2019-12-31 03:43:14

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!