Consulting

Results 1 to 3 of 3

Thread: VBA remove footers when inserting building blocks

  1. #1

    VBA remove footers when inserting building blocks

    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!
    Last edited by wannabeguru; 08-04-2015 at 12:19 PM. Reason: Typo

  2. #2
    Microsoft Word MVP 2003-2009 VBAX Guru gmaxey's Avatar
    Joined
    Sep 2005
    Posts
    3,340
    Location
    Did you unlink the footer in the section you are saving as a building block from the previous section footer before creating the BB?
    Greg

    Visit my website: http://gregmaxey.com

  3. #3
    Yes, unfortunately this method has not been reliable.
    Last edited by wannabeguru; 08-05-2015 at 08:38 AM. Reason: Being too hasty

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •