Custom Date Format

D

Dale H

We are looking to to add a custom field to a word document that would print
the date in the following format: Feb 2, 2008 would be 8033 (or 08033) where
8 (or 08) is the last digit of the current year, and 033 is the day number of
the year.

I can't seem to figure out how to set up a field that will calculate this
automatically based on the current date. (I could likely do it with VBA, but
this needs to be applied to many documents that already exist, so it would be
a large pain to add the code to all of them)

We are using Word 2003.
Does any guru have some ideas for me?
 
J

Jay Freedman

We are looking to to add a custom field to a word document that would print
the date in the following format: Feb 2, 2008 would be 8033 (or 08033) where
8 (or 08) is the last digit of the current year, and 033 is the day number of
the year.

I can't seem to figure out how to set up a field that will calculate this
automatically based on the current date. (I could likely do it with VBA, but
this needs to be applied to many documents that already exist, so it would be
a large pain to add the code to all of them)

We are using Word 2003.
Does any guru have some ideas for me?

The top guru of date fields, fellow MVP macropod, posts his comprehensive
discussion at http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=249902.
Download the attachment (direct address
http://www.wopr.com/w3tfiles/10-249902-DateCalc.zip) and look in the enclosed
Word file for the topic "Find The Day Of The Year For A Given Date". It contains
a very complex field that computes the day of year for the current date.

The year part of your request is simply a matter of formatting the DATE field:

{ DATE \@ yy }
 

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