NZ VBA Developer was telling us:
NZ VBA Developer nous racontait que :
> O Wizards of Word! Bless me with your insight!
>
[quoted text clipped - 31 lines]
> is really: Can I use an automated template to create an automated
> template?
Yes.
What I would do is use a custom Boolean document property. I would set it to
True.
Whenever the AutoNew code runs, it would check for that property. If it is
True, it means you are working form the master. Call the sub that will
collect the info, place it where it needs to go and do all the other
changes. When you are done, set the doc property to false and save the new
template.
So, when the AutoNew runs from this secondary template thus created, the
above code will not run because the property will now be set to false.
It might work better if you use a Document_Open() Sub instead. When you want
to create secondary template, actually open the Master template, do not
create a document from it with Document_New(). Make sure that the active
document is a template, then check for the Boolean. If the document is a
template and the Boolean is True, it means you have opened the Master
itself. In case you need to maintain the actual Master, you could have an
MsgBox first that would ask the user if he is ready to create a secondary
master or not. If so, run the code, if not, just open the Master as is.

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
NZ VBA Developer - 17 Aug 2007 11:08 GMT
Bloody brilliant! Cheers Mate! I'll give it a go and let you know how I get on!
> NZ VBA Developer was telling us:
> NZ VBA Developer nous racontait que :
[quoted text clipped - 57 lines]
> MsgBox first that would ask the user if he is ready to create a secondary
> master or not. If so, run the code, if not, just open the Master as is.
NZ VBA Developer - 21 Aug 2007 02:26 GMT
Jean-Guy,
Thanks again for the direction. I've now got a working 'Template Creation
Template' for one of our most common partner templates. Altho I didn't do
everything exactly as you suggested, I did build on your idea. Here's what I
came up with in the end:
I still use the AutoNew macro to run the code in the partner template, but
in the master template, it just pops a message saying that you have to open
the template to use it and then exits. I do this using a custom document
property to indicate that the template is the master, altho it's text rather
than Boolean. (I did this because I wanted to re-use the value later to aid
in the naming of a new partner template.)
I also use an AutoOpen macro (obviously, since, as stated above, you have to
open the template to use is). This macro displays a userform with options for
creating a new partner template or opening the master for editing. If you
choose 'open for editing', it just unlocks the template. However, if you
choose 'create new', it displays a userform for entering the template details.
After you have entered all the details (and they're validated), it generates
the new template, prompts for a logo (which gets formatted if it's inserted),
and then prompts to save it. I tried to force the save location to the same
location as the master, but I had a bit of a problem there. (See my later
post.)
The end result works a treat! I'm just putting a few finishing touches on it
- like a userform with instructions that requires the user to verify that
they have all the necessary info before they start - and then it's going into
production.
Thanks again for the help. I really appreciate it!
Cheers!
> NZ VBA Developer was telling us:
> NZ VBA Developer nous racontait que :
[quoted text clipped - 57 lines]
> MsgBox first that would ask the user if he is ready to create a secondary
> master or not. If so, run the code, if not, just open the Master as is.
Jean-Guy Marcil - 21 Aug 2007 03:18 GMT
NZ VBA Developer was telling us:
NZ VBA Developer nous racontait que :
> Jean-Guy,
>
[quoted text clipped - 31 lines]
>
> Thanks again for the help. I really appreciate it!
Glad I could be of assistance!

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org