inserting a future date (like inserting savedate, printdate etc)

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

Is there any way of setting up a word template that will
insert today's date + 1 month?
I want to create an invoice document that automatically
inserts the invoice date, and the due date (1month on from
the invoice date).
Thanks,
Mike
 
Mike said:
Is there any way of setting up a word template that will
insert today's date + 1 month?
I want to create an invoice document that automatically
inserts the invoice date, and the due date (1month on from
the invoice date).
Thanks,
Mike

Use a CREATEDATE field for the invoice date.
For the due date, put a bookmark at the location you wish the due date to
appear - call it Duedate
Add the following macro TO THE TEMPLATE!

Sub AutoNew()
Selection.GoTo What:=wdGoToBookmark, Name:="Duedate"
Selection.InsertBefore Format((Date + 28), "d MMMM yyyy")
End Sub

This will place a date 28 days hence at the bookmark. You can change the
number of days and the mask as required.

You can do calculated dates with fields, but these are complicated, however
investigate the examples at
http://www.wopr.com/cgi-bin/w3t/showflat.pl?Cat=&Board=wrd&Number=249902

--
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
Graham Mayor - Word MVP

Web site www.gmayor.com
Word MVP web site www.mvps.org/word
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
 
This is more complex than you might imagine, but it can be done. See <URL:
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.
--

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

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
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.
 

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

Back
Top