Create appointment skipping weekends and within a timeframe

G

GLHEC-BLS

I am using Outlook 2003. I am writing a macro and part of what it is suppose
to do is set up an appointment one day and two hours from the "Now" time. The
thing I can't figure out is how to get the appointment to skip weekends and
only set the time within the timeframe of 11 a.m. to 8 p.m. Here is what I
have that will make the appointment one day and two hours from now. Any help
is greatly appreciated!

' Set start time for one day and two hours from now...
olAppt.Start = Now() + (1#) + (2# / 24#)
 
K

Ken Slovak - [MVP - Outlook]

You can use the Weekday() function. Supply it with a date and if desired the
optional argument for first day of the week. It will return an Integer value
where Sunday = 1 and Saturday = 7. From that you can tell what day of the
week your calculated date falls on and adjust the date if needed.
 

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