For the love of God...checking if a day is a workday??!!!

Joined
Jul 19, 2011
Messages
6
Reaction score
0
I want to check if the appointment is on a working day or not. Is there an easy way to find out please? The Answer can be True/False, nothing fancy.

Any ideas? I keep thinking that AND should feature somehow...

I can get the weekday value for the day an appointment is scheduled in Outlook 2007 - Monday through to Sunday (from oAppt.Start in this case), e.g. Monday. I can get the days a user has marked as working days - Sun = 128, Mon = 64 and so on - e.g. 124 = Mon to Fri inclusive.

Thank you!
 
Last edited:
PS - This isn't as easy as it sounds. Depending on shift patterns/flexible working patterns, work days could be any group of days in the week - Sun - Weds, Mon - Thurs, Mon, Wed, Fri + Sat etc.
 
I think this is it - anyone do anything tighter?

If (myWorkDay And (2 ^ (8 - (Weekday(oAppt.Start))))) <> (2 ^ (8 - (Weekday(oAppt.Start)))) Then
Debug.Print "<>", myWorkDay, (2 ^ (8 - (Weekday(oAppt.Start)))), (myWorkDay And (2 ^ (8 - (Weekday(oAppt.Start)))))
ElseIf (myWorkDay And (2 ^ (8 - (Weekday(oAppt.Start))))) = (2 ^ (8 - (Weekday(oAppt.Start)))) Then
Debug.Print "=", myWorkDay, (2 ^ (8 - (Weekday(oAppt.Start)))), (myWorkDay And (2 ^ (8 - (Weekday(oAppt.Start)))))
End If
 
Back
Top