Solved

EWS API DailyPattern problem

Posted on 2012-03-23
1
1,471 Views
Last Modified: 2012-03-26
I’ve got a problem understanding how Microsoft supports daily patterns for weekday only with the EWS Managed API.
Creating a daily recurring meeting is pretty straight forward and there is a great example on MSDN for that:
 WebCredentials creds = new WebCredentials(userTb.Text.Trim(), passwordTb.Text.Trim(), domainTb.Text.Trim());
            ExchangeService service = Connect(creds);
 
            // Create the meeting. 
            Appointment meeting = new Appointment(service);
 
            // Set properties on the meeting.
            meeting.Subject = "Daily Meeting";
            meeting.Body = "Blah blah blah";
            meeting.Start = new DateTime(2009, 1, 1, 10, 0, 0);
            meeting.End = meeting.Start.AddHours(1);
            meeting.Location = "Conf Room 1";
            meeting.RequiredAttendees.Add("User1@contoso.com");
 
            meeting.Recurrence = new Recurrence.DailyPattern(meeting.Start.Date, 1);
            meeting.Recurrence.StartDate = meeting.Start.Date;
            meeting.Recurrence.EndDate = (meeting.Start.Date).AddDays(13);

Open in new window

However, if you open Outlook and try to manually create a daily recurring meeting there is a setting to make the daily occurrence only on weekdays.  How are they doing this since the Recurrence.DailyPattern object doesn’t have a DaysOfTheWeek property like a WeeklyPattern.  Are they really mapping between daily and weekly patterns behind the scenes to cheat and support this?
0
Comment
Question by:geoffreykruse
1 Comment
 
LVL 96

Accepted Solution

by:
Bob Learned earned 100 total points
Comment Utility
I believe that you would still use the WeeklyPattern:

How to create task to other users task folder in exchange server.
http://farukinfo.wordpress.com/2011/05/21/how-to-create-task-to-other-users-task-folder-in-exchange-server/

Recurrence.WeeklyPattern weeklyPattern = new Recurrence.WeeklyPattern(DateTime.Today, 1, new DayOfTheWeek[] 
{ 
    DayOfTheWeek.Monday, 
    DayOfTheWeek.Tuesday, 
    DayOfTheWeek.Wednesday,
    DayOfTheWeek.Thursday,
    DayOfTheWeek.Friday,
});

Open in new window

0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Check out this infographic on what you need to make a good email signature that will work perfectly for your organization.
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now