![]() |
|
|
| Become a Columnist Microsoft Exchange Site Microsoft Support SiteMSDN Exchange Site | ||
|
|
Create a recurring meeting using CDO for Exchange 2000 By Russ Iuliano, Sumatra Development LLC
The real world is full or recurrences -- from your weekly
newsmagazine and your daily paper to the monthly sales update and
the quarterly results. In ordinary life recurring functions are
crucial. For Outlook calendar applications, it is beyond
necessary. It was therefore surprising that as part of our meetingmaker to Exchange migration application we found it almost impossible to convert meetingmaker recurrences to Outlook recurrences. The functionality is documented in the CDO package, but the instantiation and implementation of it is not clear. Doing this in Outlook itself is straight-forward, but trying to do it in the context of an application that interacts with Outlook via CDO is problematic. The purpose of this article is to make clear how to set up recurring meetings and appointments via the CDO calls for Exchange 2000, so that others will benefit from our experiences. Background Sumatra develops calendar conversion software. Our main business is converting meetingmaker servers to Microsoft® Exchange 2000 (see http://www.sumatra.com). One of the most difficult problems we faced in inserting meetingmaker data into Exchange was creating recurring meetings. In our conversion work, we've found almost 10% of meetings and appointments are recurring. The client had seen and rejected solutions that turned recurring meetings into many single instances (this happens a lot with PDA device synchronization). This wasn't a problem that we could ignore. Why is it so difficult to create a meeting that recurs every Tuesday and Thursday in CDO? We read the CDO SDK documentation, browsed a dozen books, and could only find the most basic examples. In this article we'll fill in the missing pieces, and provide Visual Basic code. There are two types of recurring meetings:
On average, 60% of recurring meetings use a simple recurrence pattern. (This data comes from our study of real-world data sets.) The September 2001 Microsoft® Exchange 2000 SDK development tools provides the reference material for CDO's IAppointment and IRecurrence interfaces. We used the IRecurrence interface to create these simple recurrence patterns. The remaining 40% use complex recurrence patterns. The SDK material didn't cover these cases. Neither did Outlook Exchange resources and documents page. Questions posed to the Outlook and Exchange development community provided us with enough information to solve this puzzle. Let's pretend we have to ship a product on May 1, 2002. We want to have weekly product development meetings every Friday at 1pm through the end of March. Then as our release date approaches, we'll shift to every Tuesday and Thursday from April 1st through April 25th. This will give us plenty of time for QA! ;) The solution We use a simple recurrence pattern to create a one-hour meeting that starts on 3/1/2002 at 1pm. This meeting has four attendees, two are required, one is optional, and one an informational-only attendee. This meeting occurs once per week, and runs for five weeks. (See Figure A) We use the RecurrencePatterns.Add("ADD") to add a recurrence pattern to this meeting. Within this block, we define the first day of the week to be Sunday (.FirstDayOfWeek = cdoSunday), the frequency of the recurrence pattern to be weekly (.Frequency = cdoWeekly), the interval to be every week (.Interval = 1), and the number of instances of the pattern to be five (.Instances = 5).
Figure A
As our May 1st deadline approaches, we shift our meeting frequency into high-gear. We create a new meeting make a one-hour meeting every Tuesday and Thursday from April 1st through April 25th. (See Figure B) This requires we use a complex recurrence pattern. First, the meeting starts on April 2, 2002. We eliminate the meeting end date (the .EndDate value). Instead, we define the ending period as the PatternEndDate value in the recurrence pattern (.PatternEndDate = "2:00 PM 4/25/2002"). Since we've dropped the end date value, we must set the meeting duration (.Duration =3600) (this is one hour in seconds!) Now here's the tricky part. We use the DaysOfWeek.Add method to add the Tuesday and Thursday Recurrence Pattern (.DaysOfWeek.Add cdoTuesday and .DaysOfWeek.Add cdoThursday) Finally, because this meeting is so important, we've changed the meeting configuration to remind the user one-hour before the meeting (Fields(cdoReminderOffset) = 3600).
Figure B
Conclusion Calendars are not a one-night so much as an on-going relationship. As in any on-going relationship you want to have it all. The part that was missing for us (and many other CDO developers) was the recurring meeting part. Having cemented that in place we can now all move on to better client relationships. Download the Visual Basic Code |
||
|
|
| ||
Disclaimer: Your use of the information contained in these pages is at your sole risk. All information on these pages is provided "as is", without any warranty, whether express or implied, of its accuracy, completeness, fitness for a particular purpose, title or non-infringement, and none of the third-party products or information mentioned in the work are authored, recommended, supported or guaranteed by Pro Exchange. OutlookExchange.Com and Pro Exchange shall not be liable for any damages you may sustain by using this information, whether direct, indirect, special, incidental or consequential, even if it has been advised of the possibility of such damages.
© Copyright Pro Exchange, Inc., 2006