Deploying Word, Excel and PowerPoint templates for Microsoft Office 2016
In many shops, Mac admins have a requirement to deploy templates for Microsoft Word, Excel or PowerPoint. With Microsoft Office 2011, this is a relatively straightforward process as there is an existing directory for Word, PowerPoint and Excel templates at the location shown below:
/Applications/Microsoft Office 2011/Office/Media/Templates
Template files deployed to this location are available to all users on the Mac.
In contrast, the necessary support directories for templates are not created by Office 2016 by default, so they are not likely to exist unless templates had previously been installed. The reason for this is that Office 2016 apps are sandboxed and don’t have the ability to write to locations outside the application sandbox unless granted permission. Fortunately, the Office team at Microsoft has documented in the PDF document linked below where templates should be installed:
Installing User Content in Office 2016 for Mac:
http://macadmins.software/docs/UserContentIn2016.pdf
When I read the documentation, it showed that the correct place to store template files is at the location shown below:
/Library/Application Support/Microsoft/Office365/User Content.localized/Templates.localized
Template files deployed to that location are available to all users on the Mac.
As mentioned previously, the necessary support directories for templates are not created automatically when Office 2016 is installed. To address this, I’ve written a script that will create the needed directory structure. For more information, see below the jump.
The script shown below is designed to do the following:
- Create the directories needed for Office 2016 Word, Excel and PowerPoint templates
- Assign those directories the following permissions:
- root: Read, Write, Execute
- admin: Read, Write, Execute
- Everyone: Read, Execute
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script checks for and (if needed) creates the directories for Office 2016 templates for Word, PowerPoint and Excel | |
if [[ ! -e "/Library/Application Support/Microsoft/Office365/User Content.localized/Templates.localized" ]]; then | |
/bin/echo "Necessary support directories for Office 2016's Word, PowerPoint and Excel templates not found." | |
/bin/echo "Creating necessary support directories for Office 2016's Word, PowerPoint and Excel templates." | |
/bin/mkdir -p "/Library/Application Support/Microsoft/Office365/User Content.localized/Templates.localized" | |
/usr/sbin/chown root:admin "/Library/Application Support/Microsoft" && /bin/chmod 775 "/Library/Application Support/Microsoft" | |
/usr/sbin/chown root:admin "/Library/Application Support/Microsoft/Office365" && /bin/chmod 775 "/Library/Application Support/Microsoft/Office365" | |
/usr/sbin/chown root:admin "/Library/Application Support/Microsoft/Office365/User Content.localized" && /bin/chmod 775 "/Library/Application Support/Microsoft/Office365/User Content.localized" | |
/usr/sbin/chown root:admin "/Library/Application Support/Microsoft/Office365/User Content.localized/Templates.localized" && /bin/chmod 775 "/Library/Application Support/Microsoft/Office365/User Content.localized/Templates.localized" | |
/bin/echo "The necessary support directories for Office 2016's Word, PowerPoint and Excel templates have been created." | |
fi |
The script is also available from my Github repo:
https://github.com/rtrouton/rtrouton_scripts/tree/master/rtrouton_scripts/create_office_2016_template_directory
Thank you, great help. It is unfortunate that Microsoft so often breaks things that worked in previous versions.
So so so many thanks for this! I searched all over the GooglePlace for months, and finally found your article and linked MS PDF.