I can use AppleScript to successfully load MS word templates in Word 2011. For example:
tell application "Microsoft Word"
add addin file name (pathVar & msWordTemplateLocation) with install
end tell
where pathVar is the path to the home folder and msWordTemplateLocation is the path to the Word template.
In Word 2011 msWordTemplateLocation is Library:Application Support:Microsoft:Office:User Templates:template_name.dotm
In word 2016 msWordTemplateLocation is Library:Group Containers:UBF8T346G9.Office:User Content:Templates:template_name.dotm
This works fine in Word 2011 but not in Word 2016. In ScriptDebugger the result of the add addin command is ‘missing value’.
If I preload the Word 2016 template manually (using Word | Templates and Add-ins…) then I can get AppleScript to access and run the macros it contains, but what I want to do is make Word 2016 load the template via AppleScript, just as I can with Word 2011. I can’t assume that it will always be preloaded; in fact it generally won’t be.
I have checked, and the add addin command is available in Word 2016’s dictionary.
Has anyone out there successfully used Applescript to load a template containing VBA macros into Word 2016? I may be missing something small but relevant.