View Single Post
 
Old 03-21-2022, 09:00 AM
Peterson Peterson is offline Windows 10 Office 2019
Competent Performer
 
Join Date: Jan 2017
Posts: 143
Peterson is on a distinguished road
Default

You need to tell Word to load the building blocks in the template. You can do this by adding the following code at the beginning of your macro:
Code:
' Add this line to the beginning of your code, to access your template's building blocks:
Application.Templates.LoadBuildingBlocks
HOWEVER, I don't know if this will work because of where you are storing your templates -- you will need to test. LoadBuildingBlocks may only load building blocks from templates saved in your users' default templates location and the STARTUP folder (see below), but you are saving templates in nonstandard locations.
Code:
C:\Users\%username%\AppData\Roaming\Microsoft\Templates

C:\Users\%username%\AppData\Roaming\Microsoft\Word\STARTUP
If after you add the line of code with LoadBuildingBlocks it still doesn't work, then I strongly recommend having your users move their templates to their default location -- C:\Users\%username%\AppData\Roaming\Microsoft\Temp lates -- which is where Microsoft designed them to be stored.

Finally, modify your code to point to the template in the default location.
Reply With Quote