【问题标题】:How to setup appointment in outlook with timezone如何在带有时区的outlook中设置约会
【发布时间】:2021-08-18 06:17:47
【问题描述】:

我已经编写了一个在 Outlook 2016 中创建约会的代码,但我被困在这里更改时区。任何人都可以在这里帮助提前谢谢。

Sub Outlook_Appointment()
Dim o As Outlook.Application
Set o = New Outlook.Application

Dim ONS As Outlook.Namespace
Set ONS = o.GetNamespace("MAPI")

Dim CAL_FOL As Outlook.Folder
Set CAL_FOL = ONS.GetDefaultFolder(olFolderCalendar)

Dim myapt As Outlook.AppointmentItem
Set myapt = CAL_FOL.Items.Add(olAppointmentItem)

With myapt

    .Display
    .Start = Date + TimeValue("15:30:00")
    .End = Date + TimeValue("16:30:00")
    .Location = "Seattle"
    .Subject = "Discussion"
    .Body = "This is a test mail to block the calendar"
    .ReminderMinutesBeforeStart = TimeValue("00:15:00")
    .To = "abc@gmail.com"
    .Save

End With
End Sub

谢谢

【问题讨论】:

  • 尝试使用AppointmentItem.StartTimeZone和AppointmentItem.EndTimeZone
  • 您好,我已经按照您的说法进行了尝试。但我不确定如何发送价值?你能给我举个例子吗?在我的代码中: ``` With myapt .Display .StartTimeZone = 我应该在这里为英国传递什么 .EndTimeZone = 我应该在这里为英国传递什么以 ``

标签: vba outlook


【解决方案1】:

AppointmentItem.Start 属性值始终以本地时区表示,请查看 Application.TimeZones.CurrentTimeZone,它返回表示当前 Windows 系统本地时区的 TimeZone 值。

时区信息用于将约会映射到保存约会时的正确 UTC 时间,以及当项目在日历中显示时映射到正确的本地时间。

AppointmentItem.StartTimeZone 属性返回或设置一个TimeZone 值,该值对应于约会开始时间的时区。

AppointmentItem.EndInEndTimeZone 属性返回或设置一个 Date 值,该值表示在 AppointmentItem.EndTimeZone 中表示的约会的结束日期和时间。

【讨论】:

  • 嗨@Eugene Astafiev,我已经尝试过你提到的。但我不确定如何发送价值?你能给我举个例子吗?在我的代码中: ``` With myapt .Display .StartTimeZone = 我应该在这里为英国传递什么 .EndTimeZone = 我应该在这里为英国传递什么以 ``
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-03-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多