Strip module/macros from document created from template

M

Michael Fisher

I have a template that I am trying to make more user-friendly through the
use of macros. When one creates a new document from the template, it fills
in a number of items so that the user doesn't have to do it. When one saves
a document created from the template, the macro module is saved with it. I
would like to avoid this, so that Word doesn't ask if you want to allow
macros when you open the document.

Does anyone have an idea about how I can prevent the document from picking
up the template's macros, either by deleting the module or somehow stripping
the module when the document is saved?

Thanks,
Mike
 
J

Jay Freedman

Hi, Mike,

While Perry's workaround will do the job, the more important question
is "why are you getting macro modules in your document?" If you use
Word the way it's supposed to work, that wouldn't happen in the first
place.

I suspect you're opening the template itself from the File > Open
dialog, filling in the items, and saving the result as a "document"
(i.e., with a .doc extension) even though it's really still a
template.

What you should do is use the File > New dialog to create a document
*based on* the template. Saving a document that's created this way
never includes any macros in the document -- they stay in the template
where they belong. A beneficial side effect is that you can't forget
to change the extension on the file and accidentally overwrite the
template.

If I'm wrong about the method you're using, we need to dig deeper into
this.
 

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