View Single Post
 
Old 10-14-2018, 06:28 PM
kateabode kateabode is offline Windows 7 64bit Office 2016
Novice
 
Join Date: Sep 2018
Posts: 16
kateabode is on a distinguished road
Default 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
Reply With Quote