![]() |
|
#5
|
||||
|
||||
|
The macro and the building block should reside in the same template file. This reduces complexity when you need to distribute both to other users.
The code that is pointing at ActiveDocument.AttachedTemplate assumes you actually placed the building block in that template. The acceptable values for BuildingBlockTypes are shown on this page WdBuildingBlockTypes enumeration (Word) | Microsoft Docs So if you saved the building block in the attached template as an AutoText, with a category of General and a name of Table then the following line should work Code:
ActiveDocument.AttachedTemplate.BuildingBlockTypes(wdTypeAutoText).Categories("General").BuildingBlocks("Table").Insert Where:=Selection.Range, RichText:=True
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Styleref field returns error
|
Levi92 | Word | 6 | 10-21-2018 01:30 PM |
| StyleRef field shows <> | Stoic | Word | 2 | 04-20-2017 04:42 AM |
Insert text form field help
|
sj80 | Word | 1 | 01-26-2016 10:50 PM |
| Problem using a StyleRef field in footer | sleake | Word | 10 | 06-27-2013 07:45 AM |
StyleRef field
|
Ulodesk | Word | 4 | 03-21-2012 11:15 AM |