Documents vs Templates

  • Thread starter Montana DOJ Help Desk
  • Start date
M

Montana DOJ Help Desk

Word 2000

I have a question regarding where is the best place to store macros for a
project that I'm working on. The project will be entirely self-contained,
and the macros, forms, and toolbars should not be available to any other
document. The macros, forms, and toolbars will be the only things specific
to the template (no autotext entries, autocorrect entries, etc.).

I can save the toolbars with the document and place all the macros in the
ThisDocument module. The user forms do not exist in any other documents or
templates, and will be called only by macros within the project.

I'm planning to put everything into a template, and then base a document on
the template. But what are the specific advantages to going with a template
in this case--when things like styles, autocorrect entries, etc.--are not a
consideration?

Also, I'm having a little difficulty seeing the answer to the following
question. If everything in the ThisDocument module is available only to
that document, and if everything in a template is available to only
documents based on that template, then what is the advantage (if any) of
ever putting anything in the ThisDocument module of a template?

-- Tom

State of Montana
Department of Justice Help Desk

"Making the world a safer place."
 
S

Stephanie Krieger

Hi, Tom,

ThisDocument is primarily designed for code that
automatically runs on certain events. You can create Subs
named Document_New, Document_Open, Document_Close,
etc ... within which the sub will automatically run each
time a new document is created based on the active
template or when a document is opened or closed
(respectively).

The benefits of a template are that it will automatically
generate new documents based on that template (can be
saved to a templates directory for this purpose -- and a
new document is the default when you double-click to open
a template from Windows Explorer, for example). Also, if
you wanted its macros and toolbars to be available to all
documents -- you can save a template in the Word Startup
folder, and the toolbars and macros would automatically
be loaded and available whenever Word is opened.

If you're creating this with the intention of creating
new documents from the master, working with a template
makes good sense if for no other reason than to not have
to delete content added to the last incarnation of the
document. You put only those elements that will be
applicable to all documents in the template itself --
then you don't have extra work to do when you start a new
one based on the same template.

If, however, the users will always be working in that
document itself (rather than generating new documents
from it) -- and you're only adding macros and toolbars --
you can create it as a document just as well. However, I
recommend not putting all of your macros in the
ThisDocument code. Insert a module into your document
project and keep your code there. Modules can be exported
for backup as well as copied between documents and
templates.

Hope that answers your questions.

Best,
Stephanie Krieger
author of Microsoft Office Document Designer (from
Microsoft Press)
email: MODD_2003 at msn dot com
blog: arouet.net
 

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