Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Andy Andy is offline
external usenet poster
 
Posts: 90
Default Default to Today's date in a form

I want a date field of a Word 2003 form to default to today's date. I put in
{DATE} in the default date property but I get "A valid date or time is
required". Is there a way to do this? Thanks.

Andy
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Default to Today's date in a form

Either put a DATE field or a CREATEDATE field in the template where you want
the date to appear, or if you want today's date in a Date formfield, set the
formfield type to 'Current Date'. If you want to start with Today's date,
and allow the user to change that date to some other date, you will need
instead an on-entry macro to fill the date eg assuming the text field is
bookmarked "Date1", the following will insert the current
date in that field when you tab into it, in the format of the switch - here
"dd\MM\yyyy"


Sub SetDate()
Dim sDate As Date
sDate = Format((Now), "dd/MM/yyyy")
ActiveDocument.FormFields("Date1").Result = sDate
End Sub

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



Andy wrote:
I want a date field of a Word 2003 form to default to today's date.
I put in {DATE} in the default date property but I get "A valid date
or time is required". Is there a way to do this? Thanks.

Andy



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
Word 2002: Macro w/today's date - update date automatically MTKathy Microsoft Word Help 1 March 13th 08 10:50 PM
today's date in a form Bob W Microsoft Word Help 1 October 25th 07 06:12 AM
Use current date in the default date form field option [email protected] Microsoft Word Help 4 April 8th 07 08:27 AM
Stop changing the date of a previously saved doc to today's date! mercedesmike Microsoft Word Help 1 May 25th 06 04:27 PM
today's date gigi Microsoft Word Help 3 June 25th 05 01:03 PM


All times are GMT +1. The time now is 11:40 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"