Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hello,
As the title says, I need to embed a word .dotm template within a regular .doc/.docx file.

The reason I need to do this is because there is a somewhat larger number of templates that my company has, and they are all share code that is located in one global template.

The goal is to being able to send our clients only the .doc/.docx file, and the global .dotm template and avoid sending all of the (pretty large number of) .dotm templates.

The problem is that .doc/.docx files only store a reference to the template they're created with. (ex. A.docx stores a reference to B.docm, which in turn gets some code from OurGlobalTemplate.dotm).

My question is whether it is possible to embed the template VBA code from B.docm to A.docx (and avoid sending B.docm to our clients)?

Thanks, in advance, for any answers.
Posted
Updated 8-Feb-11 2:04am
v2
Comments
Maciej Los 8-Feb-11 11:19am    
from http://www.word07.com/file-formats.htm
Extension Use
.docx A standard Word document with no macros or code
.dotx A Word template with no macros or code
.docm A Word document that could contain macros or code
.dotm A Word template that could contain macros or code
Kizo1 9-Feb-11 8:52am    
Thank you for your response, it has helped me to some extent.
Now I am aware of the .docm word document that can contain macros and code.

But another problem has arose. When you create a "New document" from .dotm template, and save it as a .docm document, it still doesn't copy the code from the template in it, it only ads reference.

As it is now, i can only open the .dotm template and save it as a .docm document, which is rather unpleasant to work with, since after that it is not a template, and it has to be used as one (copying and pasting). :)

I now have to investigate if there is a possibility (an option) for saving the code embedded in the document. (if anyone has the answer to this, please don't hesitate to answer :) )

Thanks again.
Maciej Los 24-May-11 14:50pm    
Can you send MS Word AddIn to your clients with "OurGlobalTemplate.htm" code?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900