-
Hi Greg, I was able to get that code to work sort of.
Essentially the code is working but it doesn't like my building blocks and IDK why!
Here is my code:
Dim oCCA As ContentControl
Set oCCA = ActiveDocument.SelectContentControlsByTitle("ccINTROACTION").Item(1)
Select Case True
Case chbTR And Not chbAccounts
Set oTmp = Templates("C:\Users\sarahjane.munt\AppData\Roaming\Microsoft\Templates\Norm al.dotm")
oTmp.BuildingBlockEntries("bbTRONLY").Insert Where:=oCCA.Range, RichText:=True
Case chbTR And chbR185
Set oTmp = Templates("C:\Users\sarahjane.munt\AppData\Roaming\Microsoft\Templates\Norm al.dotm")
oTmp.BuildingBlockEntries("bbTRR185").Insert Where:=oCCA.Range, RichText:=True
End Select
Now if I try to run this it tells me there is an insert error on the building block line: Method 'Insert' of object 'BuildingBlock' failed
But if I substitute either of my my building blocks (bbTRONLY or bbTRR185) with bbTIFI from my earlier code then the code works fine! I don't understand why it would like one buildingblock and not another. I have checked that all the buildingblock properties are all the same for all buildingblocks and they are all saved in my Normal.dotm file.
Any ideas what the problem might be? Is it possible my building blocks are just corrupted?
Thanks
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules