Dynamic document properties

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
 
D

Doug Robbins - Word MVP

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
 
S

Suzanne S. Barnhill

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.
 

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