Microsoft Word 365 - Pass in location for mail merge file

Geo jf 0 Reputation points
2024-09-25T12:32:39.45+00:00

Hello all,

I am trying to setup a mail merge document that will be called from a batch file and use the local version of a CSV file as the merge file.

For example, I have a BAT file - G:\dept\letters\letters.bat that contains %OFC_EXE% G:\DEPT\Letters\FirstLetter.docx /q to call Word (OFC_EXE containing the path to winword.exe). There is also a CSV file G:\dept\letters\input.csv.

I want to put the BAT file in R:\send\letters.bat and have the document FirstLetter.docx use the input.csv file from R:\send. This would be the same for about 7 or 8 other locations - use the same Word document but merge the local version of input.csv.

Any suggestions/guidance would be appreciated.

Microsoft 365
Microsoft 365
Formerly Office 365, is a line of subscription services offered by Microsoft which adds to and includes the Microsoft Office product line.
4,953 questions
Word
Word
A family of Microsoft word processing software products for creating web, email, and print documents.
854 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,919 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.