How to get recurring appointment dates with VBA?

G

Guest

I need to loop through all future Outlook appointment items and populate a
table with the date and subject of each appointment. The problem is with
recurring apointments - how do I get the recurring dates?

If the appointment is NOT recurring, this works:

Dim ola As Outlook.AppointmentItem
For Each ola In olns.GetDefaultFolder(olFolderCalendar).Items
If ola.Start > Date Then
myDate = ola.Start
mySubject = ola.Subject
End If

But the above code will not return recurring appointments.

I've tried this, but no luck:

If ola.IsRecurring Then
Dim varItem As Variant
Dim apptRcrPat As Outlook.RecurrencePattern
Dim apptRcr As Outlook.AppointmentItem
Set apptRcrPat = ola.GetRecurrencePattern
For Each varItem In apptRcrPat
Debug.Print varItem
Next
End If

Suggestions welcome. Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top