通过 EWS 提取的约会在 MIME 内容中没有与会者

Appointment pulled via EWS does not have attendees in mime content

我正在使用以下代码将约会导出为 .ics 文件

Dim properties = New PropertySet(BasePropertySet.FirstClassProperties, ItemSchema.MimeContent, AppointmentSchema.RequiredAttendees, AppointmentSchema.OptionalAttendees)
Dim item = Appointment.Bind(_exchangeService, New ItemId(itemId), properties)

Using fileStream = File.OpenWrite("C:\Test\appt.ics")

    fileStream.Write(item.MimeContent.Content, 0, item.MimeContent.Content.Length)

End Using

生成的 .ics 文件不包含与会者的任何数据。我如何导出这些数据?

调试时,item 上的 RequiredAttendees 属性 填充了数据。

如果我使用 File > Save As 直接从 Outlook 导出,与会者信息就在那里。

示例输出:

展望'Save As':https://gist.github.com/rhamache/932365fab68af947686f7e7b45bb84bf

来自 EWS 导出的文件:https://gist.github.com/rhamache/61509c718da6f8072c0694958eb8ac70

如您所见,从 EWS 生成的 .ics 文件缺少与会者,并且 X-ALT-DESC(可能还缺少其他内容)

如果 Aspose 能简化事情,我可以访问它

这是正常的,在 EWS 中是可以预期的,请参阅 https://msdn.microsoft.com/en-us/library/office/dn672316(v=exchg.150).aspx

The Appointment MIME stream is an iCal (.ics) file. The .ics format is convenient because Outlook and other email clients can identify it. This is not a viable option for exporting meetings because attendee information is not provided in the MIME stream. Attachments and other properties might not be included in the MIME stream. Consider constructing the iCal format from either the Appointment object or from the XML returned by the GetItem operation. This way, you can capture more of the Exchange properties with extended properties ("X-‘ properties) in the iCal file. You can also export an appointment in XML form. Call the GetItem operation and save the XML in your system. You can also use the tracing functionality in the EWS Managed API to capture the XML to put in an XML databas