Share via

Get names from list in excel, then replace with other names in word document and create new file (automatically for 100+ files)

Anonymous
2022-07-08T10:07:10+00:00

Hi!

I have a simple table in excel with 3 columns like the following:

And I also have a template word document:

I need to create 10 different word documents, with their respective names replaced. So for the first row:

And so on.

A new file should then be produced (just called "1" or something) and then repeat.

Is this possible to automate in any way? I know little python programming, is that more suited for it than VBA?

Thanks!!

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

4 answers

Sort by: Most helpful
  1. Doug Robbins - MVP - Office Apps and Services 323.1K Reputation points MVP Volunteer Moderator
    2022-07-08T11:24:24+00:00

    In Excel, insert a row above the first row of data and into the cells of that row, type Aname, Bname and Cname

    With the document open, go to the Mailings tab of the ribbn and from the Start Mail Merge dropdown, select Letters. Then use t the Select Recipients facility to select the Excel Workbook and Sheet as the data source and at the required locations in the document, insert the Aname, Bname and Cname mergefields.

    Then save the document, and use the Merge to Individual Documents facility on my Merge Tools Add-in that is contained in the MERGE TOOLS ADD-IN.zip file that you can download from :

    https://mergetoolsaddin.com/

    Extract the files from the archive and read the:

    “READ ME – Setting up and using the Merge Tools Add-in.pdf

    to see how to install and use the various tools.

    Using those tools, it is possible to perform the following types of merge that cannot be done with Mail Merge “out-of-the-box”:

    • Merge to e-mail messages either with or without attachments, with the documents created by the merge being sent as either Word or PDF attachments or as the body of the e-mail message.
    • Merge to individual documents in either Word or PDF format with the filenames being supplied by the data in one of the fields in the data source
    • Many to One type merges, which can be used for creating documents such as invoices where there are multiple records in the data source that have common data in one of the fields
    • Merging to a document that will include a chart that is unique to each record in the data source
    • Merging a document with Content Controls
    • Merging a document that contains Legacy FormFields
    • Duplex Merges
    • Merging to a printer that will collate and staple the output created from each record in the data source.

    The requirements for using the system are:

    • The mail merge main document must be of the Letters type, though that does not mean that the output cannot be sent as an e-mail message where relevant.
    • For the Many To One, Merge with Attachments and Merge to Individual Docs utilities, the data source may be either a table or query in an Access database, or in the form of an Excel worksheet. For the Chart Merge utility, see the Mail Merging with Charts document that is included in the Merge Tools Add-in Zip file for additional requirements for the data source for use with that utility
    • For a data source in the form of an Excel worksheet, the field names must be in the first row of the worksheet and there must be a field name in all of the cells in that row that are within the range of columns that contain the data.
    • For both types of data source, the field names must contain only alphanumeric characters (No @,#,$,%,&,(,), etc) and the field names must not start with a numeric character (0-9). The number of characters in the field names, including spaces, must not be more than 40.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Doug Robbins - MVP - Office Apps and Services 323.1K Reputation points MVP Volunteer Moderator
    2022-07-09T02:54:04+00:00

    I believe it is working. However you can contact me by email at the address in my signature.

    Was this answer helpful?

    0 comments No comments
  3. Suzanne S Barnhill 278.1K Reputation points MVP Volunteer Moderator
    2022-07-08T19:51:27+00:00

    The link works for me.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2022-07-08T11:41:24+00:00

    Thanks for your reponse!

    Your link is not working, could you update it?

    Was this answer helpful?

    0 comments No comments