Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
[email protected] amcferron@mac.com is offline
external usenet poster
 
Posts: 3
Default Use current date in the default date form field option

I am creating a form and I would like the current date (the day the
user works on the form) to be the default, but I need the user to have
the option to type over that date if necessary.

I am sure this is a simple option, but I can't seem to find the right
way to insert the current date as the date field default option.

Please help!

Thanks

  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default Use current date in the default date form field option

On 7 Apr 2007 09:20:00 -0700, wrote:

I am creating a form and I would like the current date (the day the
user works on the form) to be the default, but I need the user to have
the option to type over that date if necessary.

I am sure this is a simple option, but I can't seem to find the right
way to insert the current date as the date field default option.

Please help!

Thanks


Place the following macro in the template for your form
(
http://www.gmayor.com/installing_macro.htm) and change the form name
in quotes to the name of the actual field in your template.

Sub AutoNew()
ActiveDocument.FormFields("DateField").Result = CStr(Now)
End Sub

--
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.
  #3   Report Post  
Posted to microsoft.public.word.docmanagement
[email protected] amcferron@mac.com is offline
external usenet poster
 
Posts: 3
Default Use current date in the default date form field option

Jay - Thanks so much!

I am afraid I am pretty new to Macros and I am getting Compile Error :
Syntax error.

I changed the field name ... any ideas on how I could have screwed up
something so simple?



On Apr 7, 11:44 am, Jay Freedman wrote:
On 7 Apr 2007 09:20:00 -0700, wrote:

I am creating a form and I would like the current date (the day the
user works on the form) to be the default, but I need the user to have
the option to type over that date if necessary.


I am sure this is a simple option, but I can't seem to find the right
way to insert the current date as the date field default option.


Please help!


Thanks


Place the following macro in the template for your form
(http://www.gmayor.com/installing_macro.htm) and change the form name
in quotes to the name of the actual field in your template.

Sub AutoNew()
ActiveDocument.FormFields("DateField").Result = CStr(Now)
End Sub

--
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.



  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default Use current date in the default date form field option

Don't try to type the macro into the editor -- it's too easy to make a
mistake without knowing what you're doing. Just copy the three lines
from the post and paste it into the editor, and then change the field
name.

--
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 7 Apr 2007 10:11:13 -0700, wrote:

Jay - Thanks so much!

I am afraid I am pretty new to Macros and I am getting Compile Error :
Syntax error.

I changed the field name ... any ideas on how I could have screwed up
something so simple?



On Apr 7, 11:44 am, Jay Freedman wrote:
On 7 Apr 2007 09:20:00 -0700, wrote:

I am creating a form and I would like the current date (the day the
user works on the form) to be the default, but I need the user to have
the option to type over that date if necessary.


I am sure this is a simple option, but I can't seem to find the right
way to insert the current date as the date field default option.


Please help!


Thanks


Place the following macro in the template for your form
(
http://www.gmayor.com/installing_macro.htm) and change the form name
in quotes to the name of the actual field in your template.

Sub AutoNew()
ActiveDocument.FormFields("DateField").Result = CStr(Now)
End Sub

--
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.


  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Use current date in the default date form field option

Change the field bookmarkname in the form to DateField rather than in the
macro - then it becomes even more difficult to screw it up

Note too that this macro goes in the form template and NOT in normal.dot.
Jay did say this in his original post, but it is worth emphasising.
--

Graham Mayor - Word MVP

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


Jay Freedman wrote:
Don't try to type the macro into the editor -- it's too easy to make a
mistake without knowing what you're doing. Just copy the three lines
from the post and paste it into the editor, and then change the field
name.


Jay - Thanks so much!

I am afraid I am pretty new to Macros and I am getting Compile Error
: Syntax error.

I changed the field name ... any ideas on how I could have screwed up
something so simple?



On Apr 7, 11:44 am, Jay Freedman wrote:
On 7 Apr 2007 09:20:00 -0700, wrote:

I am creating a form and I would like the current date (the day the
user works on the form) to be the default, but I need the user to
have the option to type over that date if necessary.

I am sure this is a simple option, but I can't seem to find the
right way to insert the current date as the date field default
option.

Please help!

Thanks

Place the following macro in the template for your form
(http://www.gmayor.com/installing_macro.htm) and change the form
name in quotes to the name of the actual field in your template.

Sub AutoNew()
ActiveDocument.FormFields("DateField").Result = CStr(Now)
End Sub

--
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
I want a form field to figure a date based on the letter date. Virginia Native Microsoft Word Help 2 September 22nd 06 09:52 AM
Field codes - current date +90d helbel78 Microsoft Word Help 1 November 10th 05 04:56 PM
Fillin field default to current date zSplash Mailmerge 2 July 12th 05 05:23 PM
How can a user change the default date in a form field? I_AM_SAM Tables 1 June 22nd 05 10:20 PM
How to insert future date based on current date plus 14 days John Bakker Microsoft Word Help 1 January 31st 05 09:08 PM


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