Merging Word Docs w/ Applescript
I'm writing a MS Word document with contributions from multiple authors and editors. I'm new the Applescript but I have invested a couple of days now trying to figure out how to create an application that would merge multiple word documents together. I'm using Microsoft Word for Mac Version 15.15 on a Mid 2011 iMac running OS X El Capitan 10.11.12. I'm hung up on how to use the merge command in the Script Editor. Starting with just two documents, I'm writing things like:
tellapplication "Microsoft Word"
openfile name ((path todesktop folder) & "TestingMerge.docx") asstring
set myMerge to merge file name ((path to desktop folder) & "TestingMerge2.docx") as string
end tell
I keep getting an error:
Result:
error "Microsoft Word got an error: Can’t continue merge." number -1708
I'm done many variations on this general theme, but just don't know how to use the merge command correctly or there is some weird bug that has broken this command. I've looked everywhere for applescript code from anybody that has used the merge command to see how the syntax and format is supposed to look, but I haven't found anything.
Any help would be much appreciated.
iMac, OS X El Capitan (10.11.2)