I'm currently using the following code to export a list of the weekly meetings and appointments I have:
Option Explicit
Sub Outlook_calendaritemsexport()
Application.ScreenUpdating = False
Sheet6.Select
'clearing old dates
Range("A2:E2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents
Range("G4").Select
Dim FromDateWEEK As Date
Dim ToDateWEEK As Date
Dim FromDateDAY As Date
Dim ToDateDAY As Date
FromDateWEEK = Cells(2, 8).Value
ToDateWEEK = Cells(2, 9).Value
Dim o As Outlook.Application, R As Long
Set o = New Outlook.Application
Dim ons As Outlook.Namespace
Set ons = o.GetNamespace("MAPI")
Dim myfol As Outlook.Folder
Set myfol = ons.GetDefaultFolder(olFolderCalendar)
Dim myapt As Outlook.AppointmentItem
Dim outRecurrencePattern As Object
Range("A1:D1").Value = Array("Subject", "Start", "End", "Project", "Duration (Hrs)")
R = 1
For Each myapt In myfol.Items
If (myapt.Start >= FromDateWEEK And myapt.Start <= ToDateWEEK) Then
'Loop through recurring events for this appointment
R = R + 1
Cells(R, 1).Value = myapt.Subject
Cells(R, 2).Value = myapt.Start
Cells(R, 3).Value = myapt.End
Cells(R, 4).Value = myapt.Categories
Cells(R, 5).Value = ((myapt.End - myapt.Start) * 1440) / 60
Else
End If
Next
Set o = Nothing
Set ons = Nothing
Set myfol = Nothing
Set myapt = Nothing
Application.ScreenUpdating = True
End Sub
However, the recurring meetings/appointments are not exported when I use the aforementioned code. I looked online for a solution, but all the examples I could find involved scheduling appointments rather than keeping a list of them. Is there a way to include all occurrences in the date range and the recurring appointments in the export list? (1 week).