2

我在网上看到这个问题问了好几次,但找不到答案。

当我使用托管 EWS 2.0 创建约会(会议)时,邀请电子邮件正确显示时间和时区。当我更新会议时,新的邀请电子邮件会显示 UTC 时区的时间。这是 UTC 的正确时间,但应该显示在太平洋。

我在创建服务连接时尝试设置区域,但这使得初始邀请也将时区显示为 UTC,以及任何更新。

我尝试设置 StartTimeZone 和 EndTimeZone 属性,并在绑定约会以进行修改时将这些属性包含在属性集中。

是否有其他属性可以控制 Exchange 在发送邀请时如何格式化时间?这是一些显示我如何执行更新的代码:

        Dim EWS As ExchangeService = GetEWSConnection(UserEmailAddress)
        Dim meeting As Appointment = Appointment.Bind(EWS, New ItemId(CalendarEvent.ItemKey), New PropertySet(BasePropertySet.IdOnly, AppointmentSchema.Start, AppointmentSchema.End, AppointmentSchema.ReminderDueBy, AppointmentSchema.StartTimeZone, AppointmentSchema.EndTimeZone, AppointmentSchema.TimeZone, AppointmentSchema.Subject, AppointmentSchema.Location, AppointmentSchema.Body))
        Dim timeZone As TimeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(LocalTimeZoneID)
        With meeting
            .Subject = CalendarEvent.Subject
            .Location = CalendarEvent.Location
            .Body = CalendarEvent.Body
            .Start = CalendarEvent.StartTime
            .End = CalendarEvent.EndTime
            .StartTimeZone = timeZone
            .EndTimeZone = timeZone
            '  snip  (removed attendee add/remove)
            .Update(ConflictResolutionMode.AlwaysOverwrite, SendInvitationsOrCancellationsMode.SendToChangedAndSaveCopy)
        End With
4

1 回答 1

0

我意识到这是一个令人沮丧的答案,但我相信这是一个 Exchange 错误。无论您如何调整 API 公开的各种时区属性,这种行为仍然会发生。据我所知,也没有任何服务器级设置会影响这一点,尽管我承认我还没有仔细研究过所有这些设置。

就我而言,附加的 UTC 时间似乎伴随着消息在更新时从其原始 HTML 更改为纯文本版本。该错误 ( http://support.microsoft.com/kb/2689810 ) 已修复,但我的组织尚未应用该补丁。我想,当另一个错误被修复时,这个错误可能已经过时了。如果可以选择在 Exchange 服务器上安装更新,那么这可能值得一试。

于 2013-02-11T04:33:35.463 回答