[英]EWS managed API - Appointment with Html Body and Outlook 2013
I'm trying to create an Appointment with an Html Body containing a Hyperlink, like it is shown in this Example: 我正在尝试使用包含超链接的HTML正文创建约会,如本示例所示:
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: 当我在Outlook 2010中打开此约会时,正文看起来像预期的那样:
But in Outlook 2013, the formatting of the Body is lost and it looks like this: 但是在Outlook 2013中,主体的格式丢失了,看起来像这样:
Any idea how i can fix this Problem? 任何想法我如何可以解决此问题?
The MS-OXCAL ( section 2.2.1.38 ) standard document seems to suggest that appointments need to be specified in Rich Text Format. MS-OXCAL( 第2.2.1.38节 )标准文档似乎建议需要以RTF格式指定约会。 You might want to try writing the body in that, perhaps using a library like .NET RTF Writer .
您可能想要尝试使用该脚本编写主体,也许使用.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. 我认为您之所以会做出怪异的更改,是因为链中的某些内容将HTML转换为RTF。 This question has a lot more detail.
这个问题有更多细节。
The property PR_RTF_COMPRESSED is what you need. 您需要属性PR_RTF_COMPRESSED。 It is MAPI property supported as extended property in EWS Managed API and Exchange Web Services .NET
在EWS托管API和Exchange Web Services .NET中,作为扩展属性支持MAPI属性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.