Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
cjlanphear
 
Posts: n/a
Default Date functions!!!!

How can I enter a date (any date) and have it display with the day of the week?
  #2   Report Post  
Posted to microsoft.public.word.tables
Jay Freedman
 
Posts: n/a
Default Date functions!!!!

One of the formats of the \@ (Picture) switch can do that for any date
you can enter.

The first part is to get some way to enter the desired date into a
bookmark. For this you can use the Insert Field dialog to create an
ASK field like this:

{ASK datebk "Enter date:"}

The ASK field is invisible when its field code is collapsed. When this
field is updated, it displays a box with the prompt -- in this case
"Enter date:" -- and a place to enter text, plus OK and Cancel
buttons. When you enter something and click OK, it creates or updates
a bookmark -- in this case, one named "datebk" -- inside the field.

The next part is to display the result with a QUOTE field like this:

{QUOTE {datebk} \@ "dddd"}

You must create the {datebk} field inside the QUOTE field by selecting
the word datebk and pressing Ctrl+F9 -- you can't do it in the Insert
Field dialog.


When this field is updated, the current content of the datebk bookmark
is substituted for the inner field in the QUOTE field. Then the
Picture switch tells Word to display the day of the week corresponding
to that date.

I'd advise putting the ASK field and the QUOTE field right next to
each other. To use them, select the piece of text (the line,
paragraph, or the whole document) and press F9 to update the fields in
the selection. Or you can switch to Print Preview, which (depending on
an option setting) can update all fields in the document.

Be careful: there's no error checking of the entry in the ASK field.
When the box pops up, you could type in something that isn't a date,
or any nonsense characters. The ASK field won't care, but the QUOTE
field will usually just repeat what you typed rather than converting
it to a day name. The undesirable case is if you type something where
the beginning part could be interpreted as a date, so the QUOTE field
will display a day name but it could be wrong.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

On Wed, 7 Jun 2006 08:56:02 -0700, cjlanphear
wrote:

How can I enter a date (any date) and have it display with the day of the week?

  #3   Report Post  
Posted to microsoft.public.word.tables
macropod
 
Posts: n/a
Default Date functions!!!!

Hi Jay,

Simpler:
{FILLIN "Enter a date" \@ DDDD}
though I'd be inclined to take it one step further and use:
{FILLIN "Enter a date" \@ DDDD \d {DATE \@ "DD-MMM-YYYY"}}

Cheers

--
macropod
[MVP - Microsoft Word]


"Jay Freedman" wrote in message
...
One of the formats of the \@ (Picture) switch can do that for any date
you can enter.

The first part is to get some way to enter the desired date into a
bookmark. For this you can use the Insert Field dialog to create an
ASK field like this:

{ASK datebk "Enter date:"}

The ASK field is invisible when its field code is collapsed. When this
field is updated, it displays a box with the prompt -- in this case
"Enter date:" -- and a place to enter text, plus OK and Cancel
buttons. When you enter something and click OK, it creates or updates
a bookmark -- in this case, one named "datebk" -- inside the field.

The next part is to display the result with a QUOTE field like this:

{QUOTE {datebk} \@ "dddd"}

You must create the {datebk} field inside the QUOTE field by selecting
the word datebk and pressing Ctrl+F9 -- you can't do it in the Insert
Field dialog.


When this field is updated, the current content of the datebk bookmark
is substituted for the inner field in the QUOTE field. Then the
Picture switch tells Word to display the day of the week corresponding
to that date.

I'd advise putting the ASK field and the QUOTE field right next to
each other. To use them, select the piece of text (the line,
paragraph, or the whole document) and press F9 to update the fields in
the selection. Or you can switch to Print Preview, which (depending on
an option setting) can update all fields in the document.

Be careful: there's no error checking of the entry in the ASK field.
When the box pops up, you could type in something that isn't a date,
or any nonsense characters. The ASK field won't care, but the QUOTE
field will usually just repeat what you typed rather than converting
it to a day name. The undesirable case is if you type something where
the beginning part could be interpreted as a date, so the QUOTE field
will display a day name but it could be wrong.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

On Wed, 7 Jun 2006 08:56:02 -0700, cjlanphear
wrote:

How can I enter a date (any date) and have it display with the day of the

week?


  #4   Report Post  
Posted to microsoft.public.word.tables
Jay Freedman
 
Posts: n/a
Default Date functions!!!!

Very nice, thank you!

I don't usually play with ASK and FILLIN fields, because they pop up
to annoy you every time you print unless you lock them or unlink them.
If this was a form with a number of fields to fill, I'd do it with a
userform -- date manipulations in VBA are a lot easier than those in
fields.

Jay

On Thu, 8 Jun 2006 07:43:19 +1000, "macropod"
wrote:

Hi Jay,

Simpler:
{FILLIN "Enter a date" \@ DDDD}
though I'd be inclined to take it one step further and use:
{FILLIN "Enter a date" \@ DDDD \d {DATE \@ "DD-MMM-YYYY"}}

Cheers

--
macropod
[MVP - Microsoft Word]


"Jay Freedman" wrote in message
.. .
One of the formats of the \@ (Picture) switch can do that for any date
you can enter.

The first part is to get some way to enter the desired date into a
bookmark. For this you can use the Insert Field dialog to create an
ASK field like this:

{ASK datebk "Enter date:"}

The ASK field is invisible when its field code is collapsed. When this
field is updated, it displays a box with the prompt -- in this case
"Enter date:" -- and a place to enter text, plus OK and Cancel
buttons. When you enter something and click OK, it creates or updates
a bookmark -- in this case, one named "datebk" -- inside the field.

The next part is to display the result with a QUOTE field like this:

{QUOTE {datebk} \@ "dddd"}

You must create the {datebk} field inside the QUOTE field by selecting
the word datebk and pressing Ctrl+F9 -- you can't do it in the Insert
Field dialog.


When this field is updated, the current content of the datebk bookmark
is substituted for the inner field in the QUOTE field. Then the
Picture switch tells Word to display the day of the week corresponding
to that date.

I'd advise putting the ASK field and the QUOTE field right next to
each other. To use them, select the piece of text (the line,
paragraph, or the whole document) and press F9 to update the fields in
the selection. Or you can switch to Print Preview, which (depending on
an option setting) can update all fields in the document.

Be careful: there's no error checking of the entry in the ASK field.
When the box pops up, you could type in something that isn't a date,
or any nonsense characters. The ASK field won't care, but the QUOTE
field will usually just repeat what you typed rather than converting
it to a day name. The undesirable case is if you type something where
the beginning part could be interpreted as a date, so the QUOTE field
will display a day name but it could be wrong.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

On Wed, 7 Jun 2006 08:56:02 -0700, cjlanphear
wrote:

How can I enter a date (any date) and have it display with the day of the

week?


--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Concerning Current Date Changes On Past Documents smartasien Microsoft Word Help 2 May 2nd 06 03:31 PM
Date Field Merge George Mathew Mailmerge 3 January 24th 06 09:26 PM
The Web Archive Converter puts todays date on MHT copies of old f zzz Microsoft Word Help 1 December 12th 05 12:56 PM
Document Creation Date Thomas M Microsoft Word Help 3 October 29th 05 04:02 AM
Setting default headers and fonts in a template officequestions Microsoft Word Help 5 August 31st 05 01:54 PM


All times are GMT +1. The time now is 08:58 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"