Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   Weekday function (http://www.outlookbanter.com/outlook-vba/53336-weekday-function.html)

DENNIS BROWN July 25th 07 10:41 PM

Weekday function
 
When using the Weekday function, can I use a string, and if so, what format?
I have to retrieve the needed date from the Start property of an appointment item, but what format will I need to convert the string to in order to get the Weekday function to work?

--

Thanks,
Dennis

Sue Mosher [MVP-Outlook] July 26th 07 12:25 AM

Weekday function
 
The Weekday() function takes a date as its argument, so if myAppt is your appointment:

intDayOfWeek = Weekday(myAppt.Start)

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"DENNIS BROWN" wrote in message . ..
When using the Weekday function, can I use a string, and if so, what format?
I have to retrieve the needed date from the Start property of an appointment item, but what format will I need to convert the string to in order to get the Weekday function to work?

--

Thanks,
Dennis

DENNIS BROWN July 26th 07 01:34 PM

Weekday function
 
But what if MyApp.Start contains something like
6/26/2007 9:35:00
Will it still process it?

--

Thanks,
Dennis
"Sue Mosher [MVP-Outlook]" wrote in message ...
The Weekday() function takes a date as its argument, so if myAppt is your appointment:

intDayOfWeek = Weekday(myAppt.Start)

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"DENNIS BROWN" wrote in message . ..
When using the Weekday function, can I use a string, and if so, what format?
I have to retrieve the needed date from the Start property of an appointment item, but what format will I need to convert the string to in order to get the Weekday function to work?

--

Thanks,
Dennis

Sue Mosher [MVP-Outlook] July 26th 07 02:01 PM

Weekday function
 
Why not try it and see for yourself? Just type this into the Immediate window in VBA and press Enter:

? Weekday(#6/26/2007 9:35:00#)

TIP: The way to become productive and knowledgeable writing any kind of code is to experiment on your own.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"DENNIS BROWN" wrote in message . ..
But what if MyApp.Start contains something like
6/26/2007 9:35:00
Will it still process it?

--

Thanks,
Dennis
"Sue Mosher [MVP-Outlook]" wrote in message ...
The Weekday() function takes a date as its argument, so if myAppt is your appointment:

intDayOfWeek = Weekday(myAppt.Start)


"DENNIS BROWN" wrote in message . ..
When using the Weekday function, can I use a string, and if so, what format?
I have to retrieve the needed date from the Start property of an appointment item, but what format will I need to convert the string to in order to get the Weekday function to work?



All times are GMT +1. The time now is 03:39 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com