PDA

View Full Version : VBA remove footers when inserting building blocks



wannabeguru
08-04-2015, 12:18 PM
Hi gurus,

I am using the below code to insert Building Blocks based on a user's selection in a UserForm. My issue is that all of the Building Blocks are picking up the footer from the first Building Block.

Is there a way to stop this happening within VBA? I have tried using section breaks in the Building Blocks and it is not working reliably.


Set rg = ActiveDocument.Range
rg.Collapse wdCollapseEnd
If CBMerchantAgreement.Value = True Then
Set rg = tmpl.BuildingBlockEntries("MERCHANT AGREEMENT").Insert( _
where:=rg, RichText:=True)
With rg.Font
.Name = "Times New Roman"
End With
End If


Thanks for any help!

gmaxey
08-04-2015, 03:33 PM
Did you unlink the footer in the section you are saving as a building block from the previous section footer before creating the BB?

wannabeguru
08-05-2015, 06:24 AM
Yes, unfortunately this method has not been reliable.