Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Calendaring / March 2005

Tip: Looking for answers? Try searching our database.

Problem with recurring appointments

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jakob Olsen - 29 Mar 2005 13:08 GMT
Hi,

I am trying to copy appointments from Outlook2003 out to another program and
I am having trouble with recurring appointments.

I have this code, that is supposed to copy appointments i a specified period
of time:

       Set objOlItems = objOlCaFolder.Items
       objOlitems.IncludeRecurrences = True
       objOlitems.Sort "[Start]"
       objOlitems.Find "[Start] > 01-04-2005 AND [End] < 01-05-2005

       For Each objOlItem In objOlitems
           If objOlItem.Class = olAppointment Then
               ...do stuff
           End If
       Next

My problems are:
1) I have only found that the EntryID on the AppointmentItem is unique but
with recurring items they all have the same EntryID. Is there another
property I can use to disinguish between recurring appointments?
2) Eventhough I have set the Find-property all items that are recurring
return all recurrences as long as the master is between the two dates. This
is a big problem since some recurrences are indefinite and therefore becomes
a neverending loop.

Please help!

Y/Jakob
Jakob Olsen - 29 Mar 2005 14:17 GMT
Hi

I found out the second problem myself:
I changed the code to:

   oItems.Sort "[Start]"
   oItems.IncludeRecurrences = True
   Set oItem = oItems.Find("[Start] > ""30-03-2005"" AND [End] <
""30-04-2005""")

   Do
       If oItem.Subject = "Test" Then
           MsgBox oItem.Start & vbCrLf & oItem.EntryID
       End If
       Set oItem = oItems.FindNext
   Loop Until oItem Is Nothing

But I still havn't found a solution to the first problem:
1) I have only found that the EntryID on the AppointmentItem is unique but
with recurring items they all have the same EntryID. Is there another
property I can use to disinguish between recurring appointments?

Y/Jakob

> Hi,
>
[quoted text clipped - 27 lines]
>
> Y/Jakob
Ken Slovak - [MVP - Outlook] - 29 Mar 2005 16:10 GMT
There really is only one recurring appointment, the master one. Get that
from any instance of the recurring series by using GetRecurrencePattern.
Only use that however after checking IsRecurring or you'll end up converting
non-recurring appointments into recurring ones.

Use the RecurrencePattern object's GetOccurrence method to get a specific
instance of the series. Use the Exceptions collection to get any exceptions.

Signature

Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm

> Hi,
>
[quoted text clipped - 27 lines]
>
> Y/Jakob
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.