Automatic text

L

Lynn

I have created a fillable form and want to insert automatic text every time I
open it. The text I want inserted automatically is the current date plus 14
days. (i.e., Return by: [2 weeks from the date I type this].) I know how
to do that in Excel, but the formula doesn't copy into Word, and I can't
figure out how to tell Word to do it. Can anyone help?
 
C

Charles Kenyon

You can do this with a special nested field or with vba. This is more
complex than you might imagine, but it can be done. See
http://addbalance.com/word/datefields2.htm for information on the different
kinds of ways to make a date calculation work. It includes links to pages
with fields and an explanation of different macros that can be used instead
of fields. If you use fields, base it on the CreateDate field rather than
the Date field.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
D

Doug Robbins - Word MVP

Put a { DOCVARIABLE varReturnDate } field where you want the date to be
display and have the following code in an autonew macro

With ActiveDocument
.Variables("varReturnDate").Value = Format(DateAdd("d", 14, Date), "MMMM
d, yyyy")
.Range.Fields.Update
End With

I am assuming that you are using a template and that instead of "opening"
the form, you are using File>New and selecting the template as the basis for
the form that you want to create.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
L

Lynn

Thanks to both for your suggestions.
--
Lynn


Doug Robbins - Word MVP said:
Put a { DOCVARIABLE varReturnDate } field where you want the date to be
display and have the following code in an autonew macro

With ActiveDocument
.Variables("varReturnDate").Value = Format(DateAdd("d", 14, Date), "MMMM
d, yyyy")
.Range.Fields.Update
End With

I am assuming that you are using a template and that instead of "opening"
the form, you are using File>New and selecting the template as the basis for
the form that you want to create.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

Lynn said:
I have created a fillable form and want to insert automatic text every time
I
open it. The text I want inserted automatically is the current date plus
14
days. (i.e., Return by: [2 weeks from the date I type this].) I know
how
to do that in Excel, but the formula doesn't copy into Word, and I can't
figure out how to tell Word to do it. Can anyone help?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top