Custom Office Templates

jamest
New Contributor

Does anyone know of a way we can get our custom templates to pull from the location they are stored and copy down to a directory on login using a policy to copy the files from that drive. Once they are copied down I want them to show up in Office once you open it and you see all the templates. Which directory would they need to be copied too? Any help is appreciated

3 REPLIES 3

thoule
Valued Contributor II

I drop my templates in /tmp/company/ then have a script to copy to each user's home. Office 2016, obviously. Script was written by a colleague.

cd /Users
for i in *; do
    if [ "$i" != "Deleted Users" ]; then
        if [ "$i" != "Shared" ]; then
            mkdir -p /Users/$i/Library/Group Containers/UBF8T346G9.Office/User Content.localized/Templates.localized/
            cp /tmp/company/*  /Users/$i/Library/Group Containers/UBF8T346G9.Office/User Content.localized/Templates.localized/ 
            chown -R $i /Users/$i/Library/Group Containers/UBF8T346G9.Office/User Content.localized

            mkdir -p /System/Library/User Template/English.lproj/Library/Group Containers/UBF8T346G9.Office/User Content.localized/Templates.localized/
            cp /tmp/company/*  /System/Library/User Template/English.lproj/Library/Group Containers/UBF8T346G9.Office/User Content.localized/Templates.localized/ 
        fi
    fi
done

PhillyPhoto
Valued Contributor

How about just applying them to the general templates folder in:

/Library/Application Support/Microsoft/Office365/User Content.localized/Templates.localized

Source

jamest
New Contributor

I get this error when copying the script and changing the path.

Executing Policy MS Office Templates
Running script Office Templates.sh...
Script exit code: 2
Script result: /Library/Application Support/JAMF/tmp/Office Templates.sh: line 1: cd: /Users
: No such file or directory
/Library/Application Support/JAMF/tmp/Office Templates.sh: line 2: syntax error near unexpected token `do
'
/Library/Application Support/JAMF/tmp/Office Templates.sh: line 2: `for i in *; do
'
Error running script: return code was 2.
Running Recon...
Error running recon: Connection failure: "The operation couldn’t be completed. ( error 504.)"

I am thinking it has something to do with the location