【发布时间】:2017-11-18 06:19:44
【问题描述】:
我正在使用以下代码将约会导出为 .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 属性会填充数据。
如果我直接从 Outlook 导出,使用 File > Save As,与会者信息就在那里。
示例输出:
来自 Outlook 的“另存为”:https://gist.github.com/rhamache/932365fab68af947686f7e7b45bb84bf
来自 EWS 导出的文件:https://gist.github.com/rhamache/61509c718da6f8072c0694958eb8ac70
如您所见,从 EWS 生成的 .ics 文件缺少参加者,而 X-ALT-DESC(可能还缺少其他内容)
如果 Aspose 可以简化事情,我可以使用它
【问题讨论】:
-
你可以用 Aspose.Email 的 IEWSClient API 试试看对你有没有帮助?
-
@KashifIqbal 我无法使用 aspose 向 EWS 进行身份验证,请参阅 stackoverflow.com/questions/44633386/…
标签: vb.net outlook exchangewebservices aspose