Eliminating Weekends Programmatically in Recurring Appointment

G

Guest

I have a macro which upon receipt of an E-Mail (with text info containing key
words) will use the mail info to create an Appointment item.

The mail info may contain a recurring event specified as a DAILY recurrence.
The info in the mail may have a recurrence fall on a Saturday or Sunday. I
cannot control the mail content but would like the macro to eliminate any
Saturday or Sunday recurrences (i.e. only create the weekday recurrences).

Any way to do this in scriipt ?

Thanks
 
D

Dave Kane [MVP - Outlook]

That is determined by the DayOfWeekMask property of the appointment's
RecurrencePattern object. For an appointment that recurs every weekday you
would set these properties on the RecurrencePattern:
RecurrenceType = olRecursDaily
Interval = 1
DayOfWeekMask = olMonday or olTuesday or olWednesday or olThursday or
olFriday
 
G

Guest

I may have done something wrong wth the olRecursDaily and DayofWeekMask
combination since I cud not get it to work together.

Even though I was working with an event originally defined as daily
recurrence, I chanced changing the olRecursDaily flag to olRecursWeekly (with
all other parameters held the same) then the DayofWeekMask worked as desired
in the several test cases I ran.

Appreciate the input.
 
K

Ken Slovak - [MVP - Outlook]

If you set DayofWeekMask you have to use olRecursWeekly. That's how it
works, despite the documentation in Help.
 

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