我在 excel 中有我朋友的出生日期,其中包含姓名和出生日期列。我必须在我的 Outlook 日历中导入生日事件,并提醒每年。
我尝试将出生日期作为开始日期和剩余日期。无法设置重复周期。
任何人都可以帮助我实现从excel到outlook的重复事件?
我不知道您的代码看起来如何,但我在 MSDN 上找到了一个对我有用的示例(Outlook 2010)。以下代码创建一个新约会并将重复设置为每两年一次:
Option Explicit
Sub CreateTestAppt()
Dim oAppt As AppointmentItem
Dim oPattern As RecurrencePattern
Set oAppt = Application.CreateItem(olAppointmentItem)
Set oPattern = oAppt.GetRecurrencePattern
With oPattern
' Appointment occurs every n-th year (with n indicated by the Interval property)
.RecurrenceType = olRecursYearNth
' Appointment recurs every 2 years (per a RecurrenceType of olRecursYearNth)
.Interval = 2
End With
oAppt.Subject = "Test appointment"
oAppt.Save
oAppt.Display
Set oPattern = Nothing
Set oAppt = Nothing
End Sub