template with dynamic content

K

Keith

All,

I have a standard corporate word template for our documentation. When we use
it to create a new document it needs to be modified with the correct document
numbers and change identities in the header footer and titles.

Is it possible to create a template that will create a document with these
filled in by supplying them in a database or some such?

So basically the template formats remain the same, but some of the content
is supplied dynamically on creation of the document from the template.

It would save a lot of time
 
R

Rob

As you can't pass data into a new document (unless opened from another
document and even then it's hackish) you'll have to decide how you want to do
it. You can add something to the Document_New event that will happen every
time you create a new doc from the template. You'll have to prompt the user
for information unless you use Application.UserName, then you could do a
database call if you have a table with data for that user. You have some
logistics to take care of before you start coding this.
 
D

David Sisson

B

Bear

Keith:

We use this approach...

All information (metadata?) for the document is stored as document
properties. We use some built-in and some custom document properties. Here
are the ones we use:

- Author
- Category (user guide, tech ref manual, etc)
- Part Number (of the doc)
- Revision date
- Revision number
- Subject (product)
- Title (compound of subject and category)

Using document properties is pretty comfortable because the Word GUI
includes dialog boxes for creating and maintaining them.

You can put fields in the headers, footers, and anywhere in the document
body when you need to insert the value of one of the properties. They update
(more-or-less automatically) when you change a value.

Eventually, we created a userform that opens when an new document is
created. The user form lists just the document properties we use, making it
simple for the author to "spec up" the document in one operation.

I can imagine it would be fairly simple to include command buttons in such a
userform to fetch values for the doc properties. (But my imagination has
gotten me in trouble before. I've never connected to a database in practice.)

Bear
 

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