Dynamic document properties

  • Thread starter Thread starter aMc
  • Start date Start date
A

aMc

Is it possible to insert fields into basic document properties?

Say I have a word document template, and I want the filename to be Report
YYYY-MM-DD where the date is the date I save the report. Is it possible for
me to put something like Report {SaveDate} into the title field of the
Document Properties so that when I go to save a file created from the
template, the current date is automatically populated?

If not, is there any other way to achieve this (that preferably doesn't
require use of vba)?

Thanks in advance,
aMc
vrth4hqlr4l001 at sneakemail dot com
 
Hi aMc

You will need to use vba.

ActiveDocument.SaveAs "Report" & Format(Date, "yyyy-mm-dd") & ".doc"

will do it.

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
If you name a macro AutoOpen, it will run every time you open a file. For a
template, probably what you want is AutoNew, which will run every time you
create a new document based on the template.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://www.mvps.org/word
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
Back
Top