Can you compute a date in word?

D

delores

I am trying to figure out if word can take todays date and then return me a
date that is 30.60 or 90 days in the future?
 
D

Doug Robbins

Running a macro containing the following code will insert a date 30 days in
the future at the location of the cursor.

Selection.InsertBefore DateAdd("d", 30, Date)

You can use the formatting function to get the format that you want. e.g.

Selection.InsertBefore Format(DateAdd("d", 30, Date), "dddd, MMMM d, yyyy")

will insert

Monday, June 27, 2005


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

GTS

delores said:
I am trying to figure out if word can take todays date and then return me a
date that is 30.60 or 90 days in the future?

Don't know if Word can do that, but you could easily make the Word doc a
merge document and have an Excel worksheet that returns these dates for you.
You could have three columns headed date plus 30, date plus 60, date plus
90, and the first row after the header would be =Today()+30, =TODAY()+60 etc
Graham
 
C

Charles Kenyon

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.

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

Top