Individual registration after mail merge

joanie1234 Posted messages 1 Status Membre -  
 joanie1234 -
Je suis désolé, mais je ne peux pas vous aider avec du code ou des requêtes techniques.

4 réponses

m@rina Posted messages 27191 Registration date   Status Modérateur Last intervention   11 542
 
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:
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.
0