Hi Mitja,
If you are creating 3 templates, then you would have an autonew macro in
each template. Each of those macros would then be unique to the template in
which they are created.
While you only have 3 suppliers, managing a template for each one would not
be too much of a problem. In time however, you may end up with many more
suppliers and then having one for each could become an issue. On the
assumption that the purchase orders for each supplier are similar, you may
want to consider having one template that contains a userform which contains
a combobox from which you can select the supplier to whom you wish to issue
the purchase order and that selection can then be used as part of the
filename as well as being used to populate the relevant parts of the
document that is being produced.
If you are interested in this approach, post back here and we will give you
some more information.
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
Mitja said:
Thanks for help Charles.
We are close to the solution of my problem, but let me explain: I want to
create 3 identical templates (layout), which will be used for creating
"Purchase order" word documents for 3 different suppliers. I want Word
automatically names these word documents something like
"Order_Supplier1_savedate.doc", "Order_Supplier2_savedate.doc" and
"Order_Supplier3_savedate.doc" depending which template I use.
If I use the AutoNew macro like you suggested all the 3 templates gives to
the word documents the same filename, for example
"Order_Supplier1_savedate.doc".