【问题标题】:Excel VBA - create Outlook appointment with Eastern Time ZoneExcel VBA - 使用东部时区创建 Outlook 约会
【发布时间】:2012-11-19 20:28:01
【问题描述】:

我有一个创建 Outlook 约会的 Excel 宏。除了需要将时区设置为“东部”之外,我可以让一切正常工作。我的一些同事住在其他时区,我想确保为他们设置了正确的时间。这是我目前拥有的代码。如何将时区设置为东部(美国和加拿大)?

Set objOL = CreateObject("Outlook.Application")
        Set objItem = objOL.CreateItem(1)
        With objItem
            .StartTimeZone = "Eastern"
            .Start = Range("B4").Text & " " & Range("C4").Text
            .End = Range("B4").Text & " " & Range("D4").Text
            .Body = "Centra Link: " & Range("K4") & vbCrLf & vbCrLf & " Phone: " & Range("I4") & vbCrLf & vbCrLf & "Lead facilitator:  " & Range("E4") & vbCrLf & "Co-facilitator:  " & Range("F4") & vbCrLf & vbCrLf & Range("MISC_HEADER") & ":  " & Range("H4")

            .Location = Range("I4") & ", Leader Code: " & Range("J4")
            .alldayevent = False
            .Subject = Range("A4")
            .ReminderMinutesBeforeStart = 30
            .ReminderSet = True
            .Save
        End With
Set objItem = Nothing
Set objOL = Nothing
MsgBox "An appointment has been created for " & Range("A4") & " on " & Range("B4"), vbOKOnly, "Calendar Appointment"

【问题讨论】:

    标签: excel vba


    【解决方案1】:

    说起来没那么容易

    .StartTimeTone = "Eastern"
    

    看这里:http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook._appointmentitem.starttimezone.aspx

    你看,你必须创建一个 TimeZone 对象,就像这里

    How to Modify Properties (Time Zone) of Recurring Appointments in Outlook 2010 VBA

    看看 siddharth rout 的回答。

    【讨论】:

      猜你喜欢
      • 2023-02-14
      • 2018-08-13
      • 1970-01-01
      • 1970-01-01
      • 2018-05-20
      • 1970-01-01
      • 2020-01-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多