Save Word 2003 doc based on input

D

Dgwood90

I have a template which gets changesd every two weeks. I want to create a
macro that will save the template based on the two dates. Is that possible?
 
D

Doug Robbins - Word MVP

I would suggest that it is a document created from the template that you
would be wanting to save with those two dates.

If the document was to be saved with today's date plus the date two weeks in
advance, the following autonew macro in the template would save any document
created from the template in the default document folder with the file name
of the form 2010-02-22 - 2010-03-08

ActiveDocument.SaveAs Format(Date, "yyyy-mm-dd") & " - " &
Format(DateAdd("d", 14, Date), "yyyy-mm-dd")

If you want the date to be the current date plus the week two weeks prior,
use

ActiveDocument.SaveAs Format(DateAdd("d", -14, Date), "yyyy-mm-dd") & " - "
& Format(Date, "yyyy-mm-dd")

That would give you document saved with the filename of 2010-02-08 -
2010-02-22

--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.
 

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