Outlook 2k3 Script: Pb While exporting to Excel

  • Thread starter Thread starter news.microsoft.com
  • Start date Start date
N

news.microsoft.com

Hi all,

From an outlook personal Form I export data to Excel,

1 ) I export Item.CreationTime but just want to have the date in this
format dd/mm/yyyy so I put MyDate in a Cell
MyDate =
day(MyItem.CreationTime)&"/"&Month(MyItem.CreationTime)&"/"&
year(MyItem.CreationTime)

Question 1)
In somme cells I have the right result eg: dd/mm/yyyy but in other
I have mm/dd/yyyy
Why ?????

Question 2) Is there A property Creation Date in this format dd/mm/yyyy
I tryed item.startDate but this value isn't always usable

2 ) I try to evaluate Item.CreationTime I Transfomed dates like this
20061113 year*10000+month*100+day
and I try this
A) if 20061005 < mydatetransformed and mydatetransformed < 20061114
then

B) DateA = 20061005
DateB = 200611014
A) if DateA < mydatetransformed and mydatetransformed <
DateB then

the Eg: A works but not the Eg: B why ? how can I do ?

Tks a lot
 
Is it possible that those cells are already formatted as date using the
other format? If all the data is set using the format you're using it should
all be formatted identically. BTW, you might want to look at the Format
function for formatting dates and times.

All dates and times are reported out as local time by Outlook in whatever
date format you have set for Windows. If you want a different format then
reformat things as you want. Internally all dates and times are stored as
UTC.

You are usually better off using DateAdd and DateDiff functions for working
with dates and times instead of using math comparisons.
 
Back
Top