Moving macro's from Template to Document

P

Peter Ryckaert

I have a template from which users can create a
document. When they then send the document to someone
else (that does not have the template), the macro's have
disappeared.

Is there a possibility to copy the macro's and modules
from the template to the document, each time a new
document is created from the template ?
 
J

Jonathan West

Hi Peter,

Peter Ryckaert said:
I have a template from which users can create a
document. When they then send the document to someone
else (that does not have the template), the macro's have
disappeared.

That is normal behaviour for Word.
Is there a possibility to copy the macro's and modules
from the template to the document, each time a new
document is created from the template ?

You can write a VBA macro that uses the OrganizerCopy method to copy the
relevant module(s) to the document.

Beware that the macros even then might not run on the target machine,
depending on what security settings the user has.
 
P

Peter Ryckaert

Hi Jonathan,

I managed to copy the macro's from the template to the
instantiated document, but how can I copy the code that
belonging to "ThisDocument" ?

Peter
 

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