I am trying to use excel data to perform various tasks on a word document. However, this will be used by other people, so I wanted to copy all contents from the word doc (an
When you find yourself using an existing document as the basis for creating new documents it's time to consider saving that document as a Word Template. This is a particular type of file (*.dotx or *.dotm) that may contain
that will be inherited and/or shared by all documents generated from the template.
In order to create a new document from a template, use the Documents.Add method, specifying the path and file name:
Dim wdDoc as Word.Document
Set wdDoc = Documents.Add(path & filename)
'From outside Word: Set wdDoc = wdApplication.Documents.Add
This will create a new document from the template, copying the complete template content without affecting the template, itself.
Note: You can also use a "plain document" (*.docx) with the Documents.Add method and it will copy the content. It will not, however, link back to that document so it can't share macros, for instance.