4 réponses
Hello,
It's normal that the formatting (and the layout) doesn't follow because the macro creates a new basic document, and therefore it is based on Normal.dotm.
So, you need to specify the template you want to use.
In the line Documents.Add, you must specify the name of the template. And since you are starting from an already created document that is based on a template, you can retrieve the name of that template and use it to create each new document.
To put at the beginning of the macro:
and to replace in the loop:
m@rina
--
Do not ask me your questions privately. I do not answer them.
It's normal that the formatting (and the layout) doesn't follow because the macro creates a new basic document, and therefore it is based on Normal.dotm.
So, you need to specify the template you want to use.
In the line Documents.Add, you must specify the name of the template. And since you are starting from an already created document that is based on a template, you can retrieve the name of that template and use it to create each new document.
To put at the beginning of the macro:
Dim my_template As String
my_template = ActiveDocument.AttachedTemplate.FullName
and to replace in the loop:
Documents.Add Template:=my_template
m@rina
--
Do not ask me your questions privately. I do not answer them.