bstephens
09-02-2010, 08:13 PM
Hi, I am using Greg Maxey's code as seen below to delete Building Blocks.
The following code will delete the building block "Test Block" just fine.
But is there a way to modify the below code so that it will delete all the building blocks that are in the category "Test Category" instead of just a single building block called "Test Block"?
Sub DeleteBBProgramatically()
Dim oTmp As Template, sPath As String
sPath = Options.DefaultFilePath(wdUserTemplatesPath) & "\Normal.dotm"
Set oTmp = Templates(sPath)
oTmp.BuildingBlockTypes(wdTypeCustom1).Categories("Test Category").BuildingBlocks("Test Block").Delete
End Sub
Thanks for your input.
Best,
Brian
The following code will delete the building block "Test Block" just fine.
But is there a way to modify the below code so that it will delete all the building blocks that are in the category "Test Category" instead of just a single building block called "Test Block"?
Sub DeleteBBProgramatically()
Dim oTmp As Template, sPath As String
sPath = Options.DefaultFilePath(wdUserTemplatesPath) & "\Normal.dotm"
Set oTmp = Templates(sPath)
oTmp.BuildingBlockTypes(wdTypeCustom1).Categories("Test Category").BuildingBlocks("Test Block").Delete
End Sub
Thanks for your input.
Best,
Brian