#1   Report Post  
Posted to microsoft.public.word.docmanagement
Mary Fetsch Mary Fetsch is offline
external usenet poster
 
Posts: 27
Default Text Form Date

In my Word 2007 document, I have a text form with Type equal to 'Date'. Is
there a way I can set the default date to be the current date? (I don't want
to set the Type to 'Current date' because then the user can't change it.)
Thanks!

Mary Fetsch
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Stefan Blom[_3_] Stefan Blom[_3_] is offline
external usenet poster
 
Posts: 6,897
Default Text Form Date

This could be done with an "Entry" macro assigned to the form field in
question. What follows is a simple version of such a macro:

Sub TestMacro()
If Trim$(ActiveDocument.FormFields("Text1") _
..Result) = "" Then
ActiveDocument.FormFields("Text1") _
..Result = Format$(Now(), "MMMM DD, YYYY")
End If
End Sub

It is assumed that the bookmark name specified for the field is "Text1"
(which is the default). If you have chosen a different name, you should of
course use that one instead.

--
Stefan Blom
Microsoft Word MVP



"Mary Fetsch" wrote in message
news
In my Word 2007 document, I have a text form with Type equal to 'Date'.
Is
there a way I can set the default date to be the current date? (I don't
want
to set the Type to 'Current date' because then the user can't change it.)
Thanks!

Mary Fetsch





  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Mary Fetsch Mary Fetsch is offline
external usenet poster
 
Posts: 27
Default Text Form Date

Thanks so much!

"Stefan Blom" wrote:

This could be done with an "Entry" macro assigned to the form field in
question. What follows is a simple version of such a macro:

Sub TestMacro()
If Trim$(ActiveDocument.FormFields("Text1") _
..Result) = "" Then
ActiveDocument.FormFields("Text1") _
..Result = Format$(Now(), "MMMM DD, YYYY")
End If
End Sub

It is assumed that the bookmark name specified for the field is "Text1"
(which is the default). If you have chosen a different name, you should of
course use that one instead.

--
Stefan Blom
Microsoft Word MVP



"Mary Fetsch" wrote in message
news
In my Word 2007 document, I have a text form with Type equal to 'Date'.
Is
there a way I can set the default date to be the current date? (I don't
want
to set the Type to 'Current date' because then the user can't change it.)
Thanks!

Mary Fetsch





.

  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Stefan Blom[_3_] Stefan Blom[_3_] is offline
external usenet poster
 
Posts: 6,897
Default Text Form Date

I'm glad I could help.

--
Stefan Blom
Microsoft Word MVP



"Mary Fetsch" wrote in message
...
Thanks so much!

"Stefan Blom" wrote:

This could be done with an "Entry" macro assigned to the form field in
question. What follows is a simple version of such a macro:

Sub TestMacro()
If Trim$(ActiveDocument.FormFields("Text1") _
..Result) = "" Then
ActiveDocument.FormFields("Text1") _
..Result = Format$(Now(), "MMMM DD, YYYY")
End If
End Sub

It is assumed that the bookmark name specified for the field is "Text1"
(which is the default). If you have chosen a different name, you should
of
course use that one instead.

--
Stefan Blom
Microsoft Word MVP



"Mary Fetsch" wrote in message
news
In my Word 2007 document, I have a text form with Type equal to 'Date'.
Is
there a way I can set the default date to be the current date? (I
don't
want
to set the Type to 'Current date' because then the user can't change
it.)
Thanks!

Mary Fetsch





.



  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Stefan Blom[_3_] Stefan Blom[_3_] is offline
external usenet poster
 
Posts: 6,897
Default Text Form Date

I'm glad I could help.

--
Stefan Blom
Microsoft Word MVP



"Mary Fetsch" wrote in message
...
Thanks so much!

"Stefan Blom" wrote:

This could be done with an "Entry" macro assigned to the form field in
question. What follows is a simple version of such a macro:

Sub TestMacro()
If Trim$(ActiveDocument.FormFields("Text1") _
..Result) = "" Then
ActiveDocument.FormFields("Text1") _
..Result = Format$(Now(), "MMMM DD, YYYY")
End If
End Sub

It is assumed that the bookmark name specified for the field is "Text1"
(which is the default). If you have chosen a different name, you should
of
course use that one instead.

--
Stefan Blom
Microsoft Word MVP



"Mary Fetsch" wrote in message
news
In my Word 2007 document, I have a text form with Type equal to 'Date'.
Is
there a way I can set the default date to be the current date? (I
don't
want
to set the Type to 'Current date' because then the user can't change
it.)
Thanks!

Mary Fetsch





.





  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Mary Fetsch Mary Fetsch is offline
external usenet poster
 
Posts: 27
Default Text Form Date


Thanks so much!

"Stefan Blom" wrote:

This could be done with an "Entry" macro assigned to the form field in
question. What follows is a simple version of such a macro:

Sub TestMacro()
If Trim$(ActiveDocument.FormFields("Text1") _
..Result) = "" Then
ActiveDocument.FormFields("Text1") _
..Result = Format$(Now(), "MMMM DD, YYYY")
End If
End Sub

It is assumed that the bookmark name specified for the field is "Text1"
(which is the default). If you have chosen a different name, you should of
course use that one instead.

--
Stefan Blom
Microsoft Word MVP



"Mary Fetsch" wrote in message
news
In my Word 2007 document, I have a text form with Type equal to 'Date'.
Is
there a way I can set the default date to be the current date? (I don't
want
to set the Type to 'Current date' because then the user can't change it.)
Thanks!

Mary Fetsch





.

  #7   Report Post  
Posted to microsoft.public.word.docmanagement
Stefan Blom[_3_] Stefan Blom[_3_] is offline
external usenet poster
 
Posts: 6,897
Default Text Form Date

This could be done with an "Entry" macro assigned to the form field in
question. What follows is a simple version of such a macro:

Sub TestMacro()
If Trim$(ActiveDocument.FormFields("Text1") _
..Result) = "" Then
ActiveDocument.FormFields("Text1") _
..Result = Format$(Now(), "MMMM DD, YYYY")
End If
End Sub

It is assumed that the bookmark name specified for the field is "Text1"
(which is the default). If you have chosen a different name, you should of
course use that one instead.

--
Stefan Blom
Microsoft Word MVP



"Mary Fetsch" wrote in message
news
In my Word 2007 document, I have a text form with Type equal to 'Date'.
Is
there a way I can set the default date to be the current date? (I don't
want
to set the Type to 'Current date' because then the user can't change it.)
Thanks!

Mary Fetsch





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
Creating a date calculation with a text form field LC Young Microsoft Word Help 2 September 28th 09 12:08 AM
Default date in Text form field brian3ps Microsoft Word Help 5 June 13th 08 05:08 PM
Date error in Text Form Field danhattan Microsoft Word Help 2 January 22nd 07 07:00 PM
Date formatting in text form field, part II Ray_Johnson Microsoft Word Help 2 February 10th 05 10:01 PM
Date formatting in text form field Ray_Johnson Microsoft Word Help 3 January 10th 05 11:18 AM


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