Merge documents Word w / Applescript

I write a MS Word document with contributions from several authors and publishers. I'm new Applescript, but I invested a few days now trying to figure out how to create an application that should merge several word documents. I use Microsoft Word for Mac Version 15.15 on a Mid 2011 iMac OS X El Capitan 10.11.12 running. I'm hung up on how to use the merge command in the Script Editor. From only two documents, I write things like:

              tell application "Microsoft Word"

name of the file Open ((path to the folder on the desktop) & "TestingMerge.docx") as string

myMerge of name of the file to Merge the value ((path to the folder on the desktop) & "TestingMerge2.docx") as string

              end say

I get an error message:

Result:

error "Microsoft Word has been an error: can not continue merger." number-1708

I did a lot of variations on this general topic, but just don't know how to use the command merge correctly or there is a weird bug that broke this command. I looked everywhere for code applescript from someone who has used the merge command to see how the syntax and format is supposed to look like, but I have not found anything.

Any help would be appreciated.

Hello

You must specify a document open and a file with the command merge path.

In the Microsoft WordApplescript dictionary:

fusion v : merges the changes marked with revision of one document to the other marks.

Merge document

file name text: the path and the name of the document to merge with this document.

a file1 set to (path to the folder on the desktop as text) & "TestingMerge.docx".

the value File2 (path to the folder on the desktop as text) & "TestingMerge2.docx".

Tell application "Microsoft Word"

the value of thisDoc1 to open the file name file1

Merge thisDoc1 file name File2

tell the end

Tags: Mac OS & System Software

Similar Questions

Maybe you are looking for