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