Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #20  
Old 03-21-2022, 09:00 AM
Peterson Peterson is offline Content blocks stop working when changing file path Windows 10 Content blocks stop working when changing file path 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
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mapped Content Controls in Building Blocks? Charles Kenyon Word 6 05-21-2021 05:40 PM
Stop hyperlink to a file from changing address - causes problems with pdf c.davidson Word 1 09-15-2020 11:11 PM
Content blocks stop working when changing file path New building blocks have stopped working (Word 2016) Genericname1111 Word 0 05-20-2020 04:17 PM
Content blocks stop working when changing file path Get image path from content control field - NO VBA possible thoerzer Word 5 10-10-2019 12:10 AM
Changing Absolute path to Relative in a Macro MrKim Excel Programming 13 01-26-2019 02:18 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:15 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft