Get Dates of Recurring Events in Shared Appointment Calendar

Status
Not open for further replies.

jhanson

Member
My environment is Windows XP and Office 2003.




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




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




The vacation calendar has recurring appointments, while the meeting calendar has both recurring appointments and recurring meeting requests. Regardless of the type, I only get the original pattern start and end dates. Any ideas of what I am doing wrong would be greatly 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


Loop
 
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.

"jhanson" <jhanson.3ycrzy@invalid> wrote in message

news:jhanson.3ycrzy@invalid...

> My environment is Windows XP and Office 2003.

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

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

> The vacation calendar has recurring appointments, while the meeting
> calendar has both recurring appointments and recurring meeting requests.
> Regardless of the type, I only get the original pattern start and end
> dates. Any ideas of what I am doing wrong would be greatly
> 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
> Loop

> > jhanson
> >
 

jhanson

Member
Thanks for confirming my worst fears! Seriously, I have been working down that path, but had my fingers crossed that I was just being ignorant of an easier way. Thanks for the reply.




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.




--
 

jhanson

Member
Thank you for confirming my worst fears! Seriously, I had resolved myself to the same general idea, but was hoping I was ignorant of an easier way. Thank you for replying!




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.




--


















"jhanson" <jhanson.3ycrzy@invalid> wrote in message


news:jhanson.3ycrzy@invalid...

>

>
 

Dragon

Member
Hello--i have the same problem, but my appointment book is not shared. Can you please give the directions to solve it in very simple terms? I don't quite understand what the solution was for jhanson's problem. Thanks
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
K Recurring Tasks on specific dates, not pattern Using Outlook 0
P Outlook tasks keeps changing (updating) dates that I type Using Outlook 2
V Why is "Value Required" checkbox greyed out for Dates? Outlook VBA and Custom Forms 2
L dynamic and static dates in Outlook contact "notes" ie. body Using Outlook 2
I Help with dates in task list. Using Outlook 5
Z Outlook for G Suite emails showing wrong dates Using Outlook 4
Z Outlook 2013 Gmail IMPA emails not showing dates only showing times Using Outlook 1
J Outlook 2013 Extract Flag Completed dates to Excel Macro Outlook VBA and Custom Forms 16
O Outlook 2016 follow-up flags--how can I add dates? Using Outlook 1
L Entering dates in Contacts and Calendar Using Outlook 4
O highlighted dates in Yearly View for Outlook 2010 Using Outlook 1
B Extract Dates for Appointment Item in Body of email Outlook VBA and Custom Forms 10
1 Incorrect dates in sent folder Using Outlook 4
C Many Expiration Dates in Custom Form Using Outlook 1
N To Do bar showing incorrect due dates on tasks Using Outlook 4
O automate dates in outlook template Using Outlook 1
R adding anniversary dates in outlook Using Outlook 2
B Birthday dates automatically (and improperly) placed in Birthday Details Using Outlook 2
D Task Start and Due Dates Using Outlook 3
T Conditional dates in Outlook Calendar Exchange Server Administration 1
C Dates changes to 1899 when Tab key hit in Time... Using Outlook 3
C dates missing when importing emails Using Outlook 5
S Inserting Dates With Quick Parts (or Macros) Using Outlook 4
S Reminders and Due Dates in Outlook 2010 Using Outlook 6
D Sending Multiple Meeting Dates in One Meeting Request Using Outlook 4
A Is there a calender preference for Julian Dates in outlook? Using Outlook 4
T Copy/export dates/times from Inbox table view Outlook Wishlist 1
T comparing and subtracting sent and received dates Outlook VBA and Custom Forms 3
D offline fatabase on laptop not remembering TASKS dates BCM (Business Contact Manager) 1
S Outlook 2016 Understand and customize prepended behavior of recurring task Using Outlook 0
J Recurrence pattern blank on recurring meetings? Using Outlook 4
G Schedule recurring email and attachments display Outlook VBA and Custom Forms 3
V Outlook 2016 Multiple recurring tasks getting created Using Outlook 0
S Changing colors of today's appointments, but not recurring ones Using Outlook 33
G Recurring tasks break links Outlook 2016 Using Outlook 5
A Unable to save recurring Meeting to Documents folder due to error Using Outlook 2
K Recurring all day annual event Using Outlook 3
P Restore an individual all-day recurring event Using Outlook 2
F Year-and-a-day recurring appointments Using Outlook 1
P Receiving a Meeting Declined notice for a recurring meeting Using Outlook 0
N Recurring invite sent w/distribution list adding/removing attendees Using Outlook 0
C Recurring Task End Date Varies Using Outlook 3
M Expected behaviour of recurring appointments? Using Outlook 2
K Outlook 2013 Recurring Tasks Not Showing Complete Outlook.com Using Outlook.com accounts in Outlook 1
G how to cancel a recurring meeting but not the organizer but all attendees need to know. Using Outlook 1
L Recurring Tasks lost Using Outlook 3
M Recurring icon for custom form task item Outlook VBA and Custom Forms 6
Diane Poremsky Scheduling a Recurring Message Using Outlook 0
Diane Poremsky Scheduling a Recurring Message Using Outlook 0
L Who Deleted My Recurring Meeting? Exchange Server Administration 6

Similar threads

Top