Put the code in a macro named AutoNew() in the template and then use
File>New and select the template when you need to create a document.

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> I have created a template that has code in the Document_Open event (in the
> ThisDocument object) to fill some combo boxes etc. I want this code to
[quoted text clipped - 9 lines]
> Thanks,
> Seamus
Seamus Conlon - 11 Jan 2006 11:08 GMT
Thanks, Doug. The initial code to set up the comboboxes etc I can
put in the AutoNew() macro and its owrks ok. But some of the
code will run when a command button is clicked and this does not
work. Is this because that code is not in the new document but in the
attached template? Could I put code in the AutoNew() macro to
copy the other code into the ThisDocument module in the new
document?
Seamus
> Put the code in a macro named AutoNew() in the template and then use
> File>New and select the template when you need to create a document.