我已经编写了在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谢谢
发布于 2021-08-17 22:17:47
AppointmentItem.Start属性值始终以本地时区表示,请查看Application.TimeZones.CurrentTimeZone,它返回表示当前TimeZone系统本地时区的Windows值。
时区信息用于在保存约会时将约会映射到正确的UTC时间,并在日历中显示项目时映射到正确的本地时间。
AppointmentItem.StartTimeZone属性返回或设置与约会开始时间的时区相对应的TimeZone值。
AppointmentItem.EndInEndTimeZone属性返回或设置一个日期值,该值表示以AppointmentItem.EndTimeZone表示的约会的结束日期和时间。
https://stackoverflow.com/questions/68821906
复制相似问题