Copying macros and button panels from template to document

C

Carsten Schröder

I've created a document template containing a number of
macros as well as an additional button pannel.
When creating a document from the document template, the
button pannel as well as the macros are available in the
document.

When another writer is working on the document, however,
the macros and the button pannels are not available if he
doesn't have the document template as well. Even if he
has the template this doesn't help because the path for
the template in the document (specified under
Extras/AddIns) is absulute, not relative, so every writer
has to adjust the path to the template, which is bullshit.

Therefore, I'm searching for a mechanism which copies the
macros and the button pannel into the document when the
document is first created (and then forget about the
template).

Any help and ideas on how to do this automatically are
very appreciated! Or maybe someone has another great idea
to handle this problem.

Regards,

Carsten
 
P

Paul Roman

I do this by copying the toolbar and macros using the
Organizer under Tools/Macro/Macros. All of my macros are
in "NewMacros" and they all get copied to the document. I
am sure that greater minds can tell you how to create
subsets of your macros so only the ones tied to the
toolbar are copied.
 
S

Shauna Kelly

Hi Carsten

It might be worth thinking about how templates are designed to be used. Templates can be used in two quite distinct ways.

First, templates can be used as the basis for a document. The general idea is that you create a template. Save in the folder shown
at Tools > Options > File Locations > User Templates *or* Workgroup Templates. When you want to create a document based on this
template, choose File > New and select your template. If your macros and toolbars are stored in that template, then they will be
available when you are working on a document based on that template.

If you send someone the document, and you want that person to use the macros and toolbars in the template as well, then you'll need
to send that person the template too.

In first this way, the macros and toolbars are *only* available to the user when working on a document based on that template.

Second, templates can be set up so that their macros and toolbars will be available to a user when they're working on any document,
based on any template. To achieve that, you can store the template anywhere. Use Tools > Templates and Add-ins. Click Add, browse to
your template and add it to the list of Global Templates and Add-ins. If you want the template to load automatically every time Word
starts, store the template in the folder shown at Tools > Options > File Locations > StartUp. Then Word will load the template every
time Word starts.

In this way, the macros and toolbars are available all the time, but you can't use the template as the basis for a new document.

There is a third way, and that's to save or copy your macros and toolbars into the document itself. I wouldn't recommend this for
several reasons. First, it makes the file unnecessarily large. Second, if anyone ever uses that document as the basis for a new
document (a poor practice, but it happens), then your toolbars and code will propagate to the new document. Third, a user will
always get a macro security warning on opening the document. So it makes sense to store your macros and toolbars in a template. If
necessary, distribute the template with instructions on where to save it.

There's some more good information at
What do Templates and Add-ins store?

http://www.mvps.org/word/FAQs/Customization/WhatTemplatesStore.htm



Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
Melbourne, Australia
 

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