Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Word 2002: Macro w/today's date - update date automatically | Microsoft Word Help | |||
today's date in a form | Microsoft Word Help | |||
Use current date in the default date form field option | Microsoft Word Help | |||
Stop changing the date of a previously saved doc to today's date! | Microsoft Word Help | |||
today's date | Microsoft Word Help |