简体   繁体   English

EWS托管的API-使用HTML正文和Outlook 2013进行约会

[英]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中打开此约会时,正文看起来像预期的那样:

Outlook 2010中的正文

But in Outlook 2013, the formatting of the Body is lost and it looks like this: 但是在Outlook 2013中,主体的格式丢失了,看起来像这样:

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.

相关问题 在我的辅助Outlook日历中创建约会(Ews管理的API) - Create Appointment in my secondary outlook calendar (Ews managed API) 使用EWS托管API从所有用户中删除日历约会 - Delete a calendar appointment from all users with EWS Managed API 使用EWS托管API 1.2获取重复模式以进行约会 - Get recurrence pattern for appointment using EWS Managed API 1.2 使用EWS托管API创建约会时,更改MeetingRequest的格式 - Change the format of the MeetingRequest when creating an Appointment using EWS Managed API Outlook 2016甚至对于使用EWS API创建的会议也显示约会图标 - Outlook 2016 showing appointment Icon even for meetings created with EWS API 如何从Outlook Exchange Server(C#)获取约会的约会正文? - How to get appointment body text for an appointment from outlook exchange server(EWS),c#? EWS托管API和Exchange 2013中的Folder.WellKnownFolderName为空 - Folder.WellKnownFolderName is null in EWS Managed API and Exchange 2013 在IIS上部署应用程序后,具有EWS托管API的Web应用程序未创建约会 - Web application with EWS Managed API is not creating appointment after deploying application on IIS 使用EWS托管API 2.0为现有约会绑定自定义扩展属性 - Bind custom extended property for existing appointment using EWS managed API 2.0 如何为Outlook约会设置时区(通过EWS API创建时) - How to Set Timezone for Outlook Appointment.When if created via EWS API
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM