Help!

Create appointment skipping weekends and within a timeframe

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Programming VBA RSS
Next:  Outlook Search folders on shared mailboxes....  
Author Message
GLHEC-BLS
External


Since: Mar 31, 2009
Posts: 1



PostPosted: Tue Mar 31, 2009 9:19 am    Post subject: Create appointment skipping weekends and within a timeframe
Archived from groups: microsoft>public>outlook>program_vba (more info?)

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#)
Back to top
Ken Slovak - [MVP - Outlo
External


Since: Oct 17, 2003
Posts: 3355



PostPosted: Wed Apr 01, 2009 9:29 am    Post subject: Re: Create appointment skipping weekends and within a timeframe [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"GLHEC-BLS" <GLHECBLS DeleteThis @discussions.microsoft.com> wrote in message
news:C8F40D49-95D1-4140-A6E3-1F622EE175BA@microsoft.com...
>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#)
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Programming VBA All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum