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

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
 
G

Graham Mayor

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

Charles Kenyon

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.
 

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