A
abc
Hi All,
I have entered an entry in my bulding blocks as follows:
Name: myentry
Gallery: QuickParts
Category: General
Template: Building Blocks.dotx
Behavior: Insert Content.
If I open the Building Blocks Organize I can insert the entry in my
document with no problems.
Now I would like to script this, so that i can insert "myentry" using a
key sequence. So I looked up some example code and came up with this script:
--------------------------------------------
Sub MyBldBlock()
Dim objTemplate As Template
Dim objBB As BuildingBlock
Set objTemplate =
ActiveDocument.AttachedTemplate.BuildingBlockEntries("building blocks.dotx")
Set objBB =
objTemplate.BuildingBlockTypes(wdTypeQuickParts).Categories("General").BuildingBlocks("myentry")
objBB.Insert Selection.Range
End Sub
---------------------------------------------------------------------------
But it does not work. It looks like I am not linking correctly the the
Building blocks.dotx template...
Any suggestion?
Thanks a lot for your help!
I have entered an entry in my bulding blocks as follows:
Name: myentry
Gallery: QuickParts
Category: General
Template: Building Blocks.dotx
Behavior: Insert Content.
If I open the Building Blocks Organize I can insert the entry in my
document with no problems.
Now I would like to script this, so that i can insert "myentry" using a
key sequence. So I looked up some example code and came up with this script:
--------------------------------------------
Sub MyBldBlock()
Dim objTemplate As Template
Dim objBB As BuildingBlock
Set objTemplate =
ActiveDocument.AttachedTemplate.BuildingBlockEntries("building blocks.dotx")
Set objBB =
objTemplate.BuildingBlockTypes(wdTypeQuickParts).Categories("General").BuildingBlocks("myentry")
objBB.Insert Selection.Range
End Sub
---------------------------------------------------------------------------
But it does not work. It looks like I am not linking correctly the the
Building blocks.dotx template...
Any suggestion?
Thanks a lot for your help!