0
今月の5日から翌月の4日(その日の予定を含む)に発生するカレンダーで、すべての予定を取得しようとしています。ここでアイテムOutlook予定表(VBA)内の予定の更新
はコードです:
Private Sub Application_Startup()
Dim oOL As New Outlook.Application
Dim oNS As Outlook.NameSpace
Dim oAppointments As Object
Dim monthlyPats As Object
Dim oAppointmentItem As Outlook.AppointmentItem
'Set up date filter
Dim sMth As Date
Dim eMth As Date
sMth = dhFirstDayInMonth() + 3 '4th of this month
eMth = dhLastDayInMonth() + 4 '4th of next month
Dim eDate As String
eDate = "[End] < '" & eMth & "'"
Dim sDate As String
sDate = "[Start] > '" & sMth & "'"
'Restrict tasks based on date filters
Set oNS = oOL.GetNamespace("MAPI")
Set oAppointments = Session.GetDefaultFolder(olFolderCalendar).Folders("Portfolio analysis scheduler").Items.Restrict(eDate)
Set monthlyPats = oAppointments.Restrict(sDate)
End Sub
dhFirstDayInMonth()とdhLastDayInMonth()関数は、単に現在の月の最初と最後の日を取得します。
私は2018年1月4日に2つのイベントを開催しています.1つは一日中繰り返されるイベントであり、もう一つは終日続く独立イベントです。
残念ながら、再発イベントのみが引き出されます。私がそれらの両方を再現させると、両方とも私が望むものであるmonthlyPatsでキャプチャされます。
誰も説明して、意味をなさないのでこの問題の解決策を提示できますか?