Get Dates of Recurring Events in Shared Appointment Calendar

J

jhanson

My environment is Windows XP and Office 2003.

I have created an access db that draws information from 3 separat
shared calendars. One calendar is for tracking scheduled vacation
another is for tracking meetings and the last is for tracking VI
visitors. I create a table to hold each calendar's information t
include recurring events over a 6 month window (current date an
forward). My code works great for the vacation info pulling i
recurring events and their appropriate start and end dates.

My problem comes with getting the information from my meeting
calendar. I used the same code from vacations, however the recurrin
events come in with the the original pattern start and end dates.
want the actual date of the recurring event in the queried time frame.


The vacation calendar has recurring appointments, while the meetin
calendar has both recurring appointments and recurring meeting requests
Regardless of the type, I only get the original pattern start and en
dates. Any ideas of what I am doing wrong would be greatl
appreciated.

here is the code snippet:

mtgAppts.Sort "[Start]"
mtgAppts.IncludeRecurrences = True
Set mtgAppts = mtgAppts.Restrict("[Start] >= '" & Date & " 12:00 am
and [Start] < '" & DateAdd("m", 1, Date) & "11:59 pm'")

Set myAppt = mtgAppts.GetFirst
Do While TypeName(myAppt) <> "Nothing"
rec.AddNew
If myAppt.IsRecurring Then
Select Case myAppt.GetRecurrencePattern
Case 0
recurPat = "Daily"
etc...
End Select
rec!RecurPattern = recurPat
End If

rec!StartDate = Format(myAppt.Start, "mmm/dd/yy")
rec!StartTime = Format(myAppt.Start, "hh:mm AMPM")
rec!EndDate = Format(myAppt.End, "mmm/dd/yy")
rec!EndTime = Format(myAppt.End, "hh:mm AMPM")
rec!Subject = myAppt.Subject
rec!Location = myAppt.Location

rec.Update
Set myAppt = mtgAppts.GetNext
Loo
 
K

Ken Slovak - [MVP - Outlook]

Outlook recurring items store a recurrence pattern on the master item. All
other occurrences of the series are then calculated from the master item, or
the Exceptions collection that is attached to the master if there are any
exceptions to the series. The series is not stored by Outlook as individual
items.

You have to interpret the pattern and use the GetOccurrence() method to get
an individual occurrence, and if you don't find it that way then you go
check the Exceptions collection and find and item in there (if any) with the
original start date of that occurrence in the series.
 

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