#1
|
|||
|
|||
VBA temperamentally not finding building block template
I'm inserting a TOC from the Building Blocks Templates. Sometimes it works, sometimes it doesn't. If I close Word and open it, (which runs macros upon opening) it comes up with the error 5941 requested member not found.
However if I stop the macro and go into word, and click on the Table of Contents drop down, not selecting anything, and then go back into VBA and run it, then it works! It's very frustrating and I don't know how to fix this. Any help is greatly appreciated. Code:
Application.Templates( _ "C:\Users\reception.AIRDG\AppData\Roaming\Microsoft\Document Building Blocks\1033\16\Built-In Building Blocks.dotx" _ ).BuildingBlockEntries("Automatic Table 2").Insert Where:=Selection.Range _ , RichText:=True |
#2
|
|||
|
|||
Try adding this before your existing troublesome line of code:
Templates.LoadBuildingBlocks |
#3
|
|||
|
|||
Quote:
Thank you so much! Worked a treat! |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
VBA Code to Access Building Block Template in Word 2013 Startup folder | rdross51 | Word VBA | 2 | 06-01-2016 07:05 PM |
VBA Word - Building Block (AutoText) - Array - Replace Text with Specific Building Blocks | jc491 | Word VBA | 7 | 01-03-2016 10:34 PM |
How to share building block macros? | rdross51 | Word VBA | 7 | 03-12-2015 08:59 AM |
Custom Building Block File Locations | ptmuldoon | Word | 5 | 01-03-2015 08:45 AM |
Building blocks show correctly in dropdown, but wrong building block populates in doc | wordgirl123 | Word | 0 | 10-03-2013 08:30 AM |