Link to home
Start Free TrialLog in
Avatar of Benjamin Teetsch
Benjamin Teetsch

asked on

How to copy the Macros from dotm to docm permamently?

Hello,

I have created a Word-Document including Macros and saved it as a Template (dotm). The goal is, to make the file available for other persons on other PCs. They must not change the original file but they have to save a new file. (Of course this is the purpose of an Office Template). The problem is, that the macros arent there if the new file was being saved once. How can I make sure that the Macros are completely copied to the new File (and not just at the first start from the Template).

With best regards
Benjamin
Avatar of Daniel Pineault
Daniel Pineault

I do not believe this to be possible, at least not without a lot of coding...  it simply isn't how templates were designed.

I typically create a shell docm with all the default setup and code, and populate it and transfer it to the end-user so they have everything, but of course, this requires a lot more work.
Avatar of Benjamin Teetsch

ASKER

Ok, Thank you. Then I think the easiest way is to distribute a docm-file and create a macro to ensuring that the original file cannot be overrwritten .
How are they accessing the dotm file?

Browse to template file location, file open and then save as docm?

If the dotm is saved in the correct location, the user should be able to see the template in their template list when going File > New > from template. This will then open a copy of the template and already as a document not a template, the user then saves as a docm, if they save as a docx they will lose the macros as docx is not macro enabled.

At least that's how I understand templates work....
Yes, thats correct. Even if I save as docm, the macros are gone. I solved the problem by distributing a docm file. On the start a macro checks if the name of document is the original document name. If this is the case, a Save-Dialog pops up to save the File with another name. This approch works fine for me. Thank you anyway for the replys.
Does the save dialogue have the correct settings to save as a docm? If saved as a docx the macros will be removed.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.