#1   Report Post  
Posted to microsoft.public.word.docmanagement
Rosemary Rosemary is offline
external usenet poster
 
Posts: 53
Default Date/Time Field

Hi,

Two questions please:

We have Windows XP and Word 2003

1. How can I create a quick keystroke or toolbar button to put a basic date
code (e.g., November 11, 2007) in my document?

2. I am curious about a technical aspect of the automatically updating
date/time field. I saw a template where a date code was inserted when you
created it. But the date code had a hyphen-like character (code?) just after
the field. Someone told me that the field doesn't know to automatically
update unless this hyphen-like character/code is there. But when I put a
date field in my document by going thru the Insert menu, I don't see a
character like that appearing after the code. Can someone tell me what that
"hyphen" actually is, and how it works?

Thanks!
Rosemary

  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default Date/Time Field

For inserting a date in the header or footer, there is an Insert Date button
on the Header and Footer toolbar (this button could also be added to any
toolbar). Anywhere in a document, you can use the Alt+Shift+D keyboard
shortcut. Both the button and the shortcut insert a DATE field using the
format you have selected as the default in the Insert | Date and Time
dialog.

Note, however, that a DATE field is probably not what you want. What you
describe is a CREATEDATE field. For more on date fields, see
http://word.mvps.org/FAQs/TblsFldsFms/DateFields.htm. There is no built-in
shortcut for inserting this field, but you can insert the field in the usual
way (by hand or through the Insert | Field dialog), formatted as desired,
and then save it as an AutoText entry; see
http://word.mvps.org/FAQs/Customization/AutoText.htm. Once you've created
the AutoText entry, there are several ways you can insert it. The usual way
is just to type the first four letters of the entry name (which should be
something you wouldn't otherwise be typing) and press Enter or (in Word
2007) F3, but you can also assign a keyboard shortcut or toolbar button
through Tools | Customize in versions before Word 2007.

For letters and other documents that should always include the creation
date, put the CREATEDATE field in the document template. It will not update
in the template itself but will show the creation date of each document
based on the template.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"Rosemary" wrote in message
...
Hi,

Two questions please:

We have Windows XP and Word 2003

1. How can I create a quick keystroke or toolbar button to put a basic

date
code (e.g., November 11, 2007) in my document?

2. I am curious about a technical aspect of the automatically updating
date/time field. I saw a template where a date code was inserted when you
created it. But the date code had a hyphen-like character (code?) just

after
the field. Someone told me that the field doesn't know to automatically
update unless this hyphen-like character/code is there. But when I put a
date field in my document by going thru the Insert menu, I don't see a
character like that appearing after the code. Can someone tell me what

that
"hyphen" actually is, and how it works?

Thanks!
Rosemary


  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Rosemary Rosemary is offline
external usenet poster
 
Posts: 53
Default Date/Time Field

Hi Suzanne,

Thank you - that was very helpful. The site explained the differences very
well.

What we have in the template I talked about is a date code that updates
every time you open the document (which is what we need - sorry, I may not
have explained clearly).

I noticed the site said you can update on print, but not necessarily on
opening the document. I believe that "hyphen-like" character that appears
just after the date code, included by the template's creator, is what gets
the field to update each time the document is opened ...?

Regards,
Rosemary



"Suzanne S. Barnhill" wrote:

For inserting a date in the header or footer, there is an Insert Date button
on the Header and Footer toolbar (this button could also be added to any
toolbar). Anywhere in a document, you can use the Alt+Shift+D keyboard
shortcut. Both the button and the shortcut insert a DATE field using the
format you have selected as the default in the Insert | Date and Time
dialog.

Note, however, that a DATE field is probably not what you want. What you
describe is a CREATEDATE field. For more on date fields, see
http://word.mvps.org/FAQs/TblsFldsFms/DateFields.htm. There is no built-in
shortcut for inserting this field, but you can insert the field in the usual
way (by hand or through the Insert | Field dialog), formatted as desired,
and then save it as an AutoText entry; see
http://word.mvps.org/FAQs/Customization/AutoText.htm. Once you've created
the AutoText entry, there are several ways you can insert it. The usual way
is just to type the first four letters of the entry name (which should be
something you wouldn't otherwise be typing) and press Enter or (in Word
2007) F3, but you can also assign a keyboard shortcut or toolbar button
through Tools | Customize in versions before Word 2007.

For letters and other documents that should always include the creation
date, put the CREATEDATE field in the document template. It will not update
in the template itself but will show the creation date of each document
based on the template.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"Rosemary" wrote in message
...
Hi,

Two questions please:

We have Windows XP and Word 2003

1. How can I create a quick keystroke or toolbar button to put a basic

date
code (e.g., November 11, 2007) in my document?

2. I am curious about a technical aspect of the automatically updating
date/time field. I saw a template where a date code was inserted when you
created it. But the date code had a hyphen-like character (code?) just

after
the field. Someone told me that the field doesn't know to automatically
update unless this hyphen-like character/code is there. But when I put a
date field in my document by going thru the Insert menu, I don't see a
character like that appearing after the code. Can someone tell me what

that
"hyphen" actually is, and how it works?

Thanks!
Rosemary



  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Rosemary Rosemary is offline
external usenet poster
 
Posts: 53
Default Date/Time Field

Hi again,

Here is the code for the date field -- I think the line I am curious about is:
Selection.TypeText Text:=Chr(31)

'Date
With Selection
.Style = ActiveDocument.Styles("Normal")
If chkDate.Value = True Then 'they checked insert as field
.InsertDateTime DateTimeFormat:="MMMM d, yyyy",
InsertAsField:=True
Selection.TypeText Text:=Chr(31)
ElseIf chkDate.Value = False Then 'they did not check insert as
field
.TypeText Text:=txtDDate.Value
End If
.TypeParagraph
End With

Best regards,
Rosemary

"Rosemary" wrote:

Hi Suzanne,

Thank you - that was very helpful. The site explained the differences very
well.

What we have in the template I talked about is a date code that updates
every time you open the document (which is what we need - sorry, I may not
have explained clearly).

I noticed the site said you can update on print, but not necessarily on
opening the document. I believe that "hyphen-like" character that appears
just after the date code, included by the template's creator, is what gets
the field to update each time the document is opened ...?

Regards,
Rosemary



"Suzanne S. Barnhill" wrote:

For inserting a date in the header or footer, there is an Insert Date button
on the Header and Footer toolbar (this button could also be added to any
toolbar). Anywhere in a document, you can use the Alt+Shift+D keyboard
shortcut. Both the button and the shortcut insert a DATE field using the
format you have selected as the default in the Insert | Date and Time
dialog.

Note, however, that a DATE field is probably not what you want. What you
describe is a CREATEDATE field. For more on date fields, see
http://word.mvps.org/FAQs/TblsFldsFms/DateFields.htm. There is no built-in
shortcut for inserting this field, but you can insert the field in the usual
way (by hand or through the Insert | Field dialog), formatted as desired,
and then save it as an AutoText entry; see
http://word.mvps.org/FAQs/Customization/AutoText.htm. Once you've created
the AutoText entry, there are several ways you can insert it. The usual way
is just to type the first four letters of the entry name (which should be
something you wouldn't otherwise be typing) and press Enter or (in Word
2007) F3, but you can also assign a keyboard shortcut or toolbar button
through Tools | Customize in versions before Word 2007.

For letters and other documents that should always include the creation
date, put the CREATEDATE field in the document template. It will not update
in the template itself but will show the creation date of each document
based on the template.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"Rosemary" wrote in message
...
Hi,

Two questions please:

We have Windows XP and Word 2003

1. How can I create a quick keystroke or toolbar button to put a basic

date
code (e.g., November 11, 2007) in my document?

2. I am curious about a technical aspect of the automatically updating
date/time field. I saw a template where a date code was inserted when you
created it. But the date code had a hyphen-like character (code?) just

after
the field. Someone told me that the field doesn't know to automatically
update unless this hyphen-like character/code is there. But when I put a
date field in my document by going thru the Insert menu, I don't see a
character like that appearing after the code. Can someone tell me what

that
"hyphen" actually is, and how it works?

Thanks!
Rosemary



  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default Date/Time Field

An ordinary DATE field would update each time the document was opened (or at
least any time that fields were updated, as when printing or switching to
Print Preview or, if it was in the header or footer, every time the document
was repaginated). Someone with some VBA knowledge will have to interpret the
macro for you; ASCII character 31 is a nonprinting character, "unit
separator," apparently used in Word as the "optional hyphen" (Ctrl+-).

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"Rosemary" wrote in message
...
Hi again,

Here is the code for the date field -- I think the line I am curious about

is:
Selection.TypeText Text:=Chr(31)

'Date
With Selection
.Style = ActiveDocument.Styles("Normal")
If chkDate.Value = True Then 'they checked insert as field
.InsertDateTime DateTimeFormat:="MMMM d, yyyy",
InsertAsField:=True
Selection.TypeText Text:=Chr(31)
ElseIf chkDate.Value = False Then 'they did not check insert as
field
.TypeText Text:=txtDDate.Value
End If
.TypeParagraph
End With

Best regards,
Rosemary

"Rosemary" wrote:

Hi Suzanne,

Thank you - that was very helpful. The site explained the differences

very
well.

What we have in the template I talked about is a date code that updates
every time you open the document (which is what we need - sorry, I may

not
have explained clearly).

I noticed the site said you can update on print, but not necessarily on
opening the document. I believe that "hyphen-like" character that

appears
just after the date code, included by the template's creator, is what

gets
the field to update each time the document is opened ...?

Regards,
Rosemary



"Suzanne S. Barnhill" wrote:

For inserting a date in the header or footer, there is an Insert Date

button
on the Header and Footer toolbar (this button could also be added to

any
toolbar). Anywhere in a document, you can use the Alt+Shift+D keyboard
shortcut. Both the button and the shortcut insert a DATE field using

the
format you have selected as the default in the Insert | Date and Time
dialog.

Note, however, that a DATE field is probably not what you want. What

you
describe is a CREATEDATE field. For more on date fields, see
http://word.mvps.org/FAQs/TblsFldsFms/DateFields.htm. There is no

built-in
shortcut for inserting this field, but you can insert the field in the

usual
way (by hand or through the Insert | Field dialog), formatted as

desired,
and then save it as an AutoText entry; see
http://word.mvps.org/FAQs/Customization/AutoText.htm. Once you've

created
the AutoText entry, there are several ways you can insert it. The

usual way
is just to type the first four letters of the entry name (which should

be
something you wouldn't otherwise be typing) and press Enter or (in

Word
2007) F3, but you can also assign a keyboard shortcut or toolbar

button
through Tools | Customize in versions before Word 2007.

For letters and other documents that should always include the

creation
date, put the CREATEDATE field in the document template. It will not

update
in the template itself but will show the creation date of each

document
based on the template.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the

newsgroup so
all may benefit.

"Rosemary" wrote in message
...
Hi,

Two questions please:

We have Windows XP and Word 2003

1. How can I create a quick keystroke or toolbar button to put a

basic
date
code (e.g., November 11, 2007) in my document?

2. I am curious about a technical aspect of the automatically

updating
date/time field. I saw a template where a date code was inserted

when you
created it. But the date code had a hyphen-like character (code?)

just
after
the field. Someone told me that the field doesn't know to

automatically
update unless this hyphen-like character/code is there. But when I

put a
date field in my document by going thru the Insert menu, I don't see

a
character like that appearing after the code. Can someone tell me

what
that
"hyphen" actually is, and how it works?

Thanks!
Rosemary






  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Rosemary Rosemary is offline
external usenet poster
 
Posts: 53
Default Date/Time Field

Thank you, Suzanne

"Suzanne S. Barnhill" wrote:

An ordinary DATE field would update each time the document was opened (or at
least any time that fields were updated, as when printing or switching to
Print Preview or, if it was in the header or footer, every time the document
was repaginated). Someone with some VBA knowledge will have to interpret the
macro for you; ASCII character 31 is a nonprinting character, "unit
separator," apparently used in Word as the "optional hyphen" (Ctrl+-).

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"Rosemary" wrote in message
...
Hi again,

Here is the code for the date field -- I think the line I am curious about

is:
Selection.TypeText Text:=Chr(31)

'Date
With Selection
.Style = ActiveDocument.Styles("Normal")
If chkDate.Value = True Then 'they checked insert as field
.InsertDateTime DateTimeFormat:="MMMM d, yyyy",
InsertAsField:=True
Selection.TypeText Text:=Chr(31)
ElseIf chkDate.Value = False Then 'they did not check insert as
field
.TypeText Text:=txtDDate.Value
End If
.TypeParagraph
End With

Best regards,
Rosemary

"Rosemary" wrote:

Hi Suzanne,

Thank you - that was very helpful. The site explained the differences

very
well.

What we have in the template I talked about is a date code that updates
every time you open the document (which is what we need - sorry, I may

not
have explained clearly).

I noticed the site said you can update on print, but not necessarily on
opening the document. I believe that "hyphen-like" character that

appears
just after the date code, included by the template's creator, is what

gets
the field to update each time the document is opened ...?

Regards,
Rosemary



"Suzanne S. Barnhill" wrote:

For inserting a date in the header or footer, there is an Insert Date

button
on the Header and Footer toolbar (this button could also be added to

any
toolbar). Anywhere in a document, you can use the Alt+Shift+D keyboard
shortcut. Both the button and the shortcut insert a DATE field using

the
format you have selected as the default in the Insert | Date and Time
dialog.

Note, however, that a DATE field is probably not what you want. What

you
describe is a CREATEDATE field. For more on date fields, see
http://word.mvps.org/FAQs/TblsFldsFms/DateFields.htm. There is no

built-in
shortcut for inserting this field, but you can insert the field in the

usual
way (by hand or through the Insert | Field dialog), formatted as

desired,
and then save it as an AutoText entry; see
http://word.mvps.org/FAQs/Customization/AutoText.htm. Once you've

created
the AutoText entry, there are several ways you can insert it. The

usual way
is just to type the first four letters of the entry name (which should

be
something you wouldn't otherwise be typing) and press Enter or (in

Word
2007) F3, but you can also assign a keyboard shortcut or toolbar

button
through Tools | Customize in versions before Word 2007.

For letters and other documents that should always include the

creation
date, put the CREATEDATE field in the document template. It will not

update
in the template itself but will show the creation date of each

document
based on the template.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the

newsgroup so
all may benefit.

"Rosemary" wrote in message
...
Hi,

Two questions please:

We have Windows XP and Word 2003

1. How can I create a quick keystroke or toolbar button to put a

basic
date
code (e.g., November 11, 2007) in my document?

2. I am curious about a technical aspect of the automatically

updating
date/time field. I saw a template where a date code was inserted

when you
created it. But the date code had a hyphen-like character (code?)

just
after
the field. Someone told me that the field doesn't know to

automatically
update unless this hyphen-like character/code is there. But when I

put a
date field in my document by going thru the Insert menu, I don't see

a
character like that appearing after the code. Can someone tell me

what
that
"hyphen" actually is, and how it works?

Thanks!
Rosemary





  #7   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Date/Time Field

The code reproduced has little to do with the Insert Date function. The
character has nothing to do with whether the date will update or not. That
is determined by

If chkDate.Value = True Then

which refers to an object chkDate which is not defined in the section of
code you have reproduced and presumably refers to a user checked box in the
document or in a userform and based on whether the value is true or false
(checked or not) the date is either inserted as a field or as text defined
elsewhere in txtDDate.Value

If you merely want to insert a date field, as the thread implies then

Selection.InsertDateTime DateTimeFormat:="MMMM d, yyyy",
InsertAsField:=True

is the code required to do that.
http://www.gmayor.com/installing_macro.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org





Suzanne S. Barnhill wrote:
An ordinary DATE field would update each time the document was opened
(or at least any time that fields were updated, as when printing or
switching to Print Preview or, if it was in the header or footer,
every time the document was repaginated). Someone with some VBA
knowledge will have to interpret the macro for you; ASCII character
31 is a nonprinting character, "unit separator," apparently used in
Word as the "optional hyphen" (Ctrl+-).


"Rosemary" wrote in message
...
Hi again,

Here is the code for the date field -- I think the line I am curious
about is: Selection.TypeText Text:=Chr(31)

'Date
With Selection
.Style = ActiveDocument.Styles("Normal")
If chkDate.Value = True Then 'they checked insert as field
.InsertDateTime DateTimeFormat:="MMMM d, yyyy",
InsertAsField:=True
Selection.TypeText Text:=Chr(31)
ElseIf chkDate.Value = False Then 'they did not check
insert as field
.TypeText Text:=txtDDate.Value
End If
.TypeParagraph
End With

Best regards,
Rosemary

"Rosemary" wrote:

Hi Suzanne,

Thank you - that was very helpful. The site explained the
differences very well.

What we have in the template I talked about is a date code that
updates every time you open the document (which is what we need -
sorry, I may not have explained clearly).

I noticed the site said you can update on print, but not
necessarily on opening the document. I believe that "hyphen-like"
character that appears just after the date code, included by the
template's creator, is what gets the field to update each time the
document is opened ...?

Regards,
Rosemary



"Suzanne S. Barnhill" wrote:

For inserting a date in the header or footer, there is an Insert
Date button on the Header and Footer toolbar (this button could
also be added to any toolbar). Anywhere in a document, you can use
the Alt+Shift+D keyboard shortcut. Both the button and the
shortcut insert a DATE field using the format you have selected as
the default in the Insert | Date and Time dialog.

Note, however, that a DATE field is probably not what you want.
What you describe is a CREATEDATE field. For more on date fields,
see http://word.mvps.org/FAQs/TblsFldsFms/DateFields.htm. There is
no built-in shortcut for inserting this field, but you can insert
the field in the usual way (by hand or through the Insert | Field
dialog), formatted as desired, and then save it as an AutoText
entry; see http://word.mvps.org/FAQs/Customization/AutoText.htm.
Once you've created the AutoText entry, there are several ways you
can insert it. The usual way is just to type the first four
letters of the entry name (which should be something you wouldn't
otherwise be typing) and press Enter or (in Word 2007) F3, but you
can also assign a keyboard shortcut or toolbar button through
Tools | Customize in versions before Word 2007.

For letters and other documents that should always include the
creation date, put the CREATEDATE field in the document template.
It will not update in the template itself but will show the
creation date of each document based on the template.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

"Rosemary" wrote in message
...
Hi,

Two questions please:

We have Windows XP and Word 2003

1. How can I create a quick keystroke or toolbar button to put a
basic date code (e.g., November 11, 2007) in my document?

2. I am curious about a technical aspect of the automatically
updating date/time field. I saw a template where a date code was
inserted when you created it. But the date code had a
hyphen-like character (code?) just after the field. Someone told
me that the field doesn't know to automatically update unless
this hyphen-like character/code is there. But when I put a date
field in my document by going thru the Insert menu, I don't see a
character like that appearing after the code. Can someone tell
me what that "hyphen" actually is, and how it works?

Thanks!
Rosemary



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
UK dating in date-time picture field catherine Mailmerge 3 October 7th 22 06:05 PM
date field switch so it doesn't update every time you open docume. IreneHen Microsoft Word Help 3 October 8th 05 05:58 AM
Date Time Field that auto updates - Merge Documents niv Microsoft Word Help 1 October 4th 05 04:34 PM
how do i delete "time" from date/time merge field in mail merge? 3kmom Mailmerge 1 April 7th 05 07:50 AM
How to prevent Merged Date Field showing time? jmasood Mailmerge 1 February 21st 05 11:59 AM


All times are GMT +1. The time now is 11:02 AM.

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"