Link headers/footers to previous in BackCoverPage section

Robie
5StarLounger
Posts: 656
Joined: 18 Feb 2010, 14:26

Link headers/footers to previous in BackCoverPage section

Post by Robie »

Hi

I am trying to link to previous/overwrite headers/footers in all sections with the header/footer from section 3 under VBA. The documents have been setup a "Back Cover Section" which includes Appendices and the actual back cover (separate section from Appendices section). For some reason, I can't replace the headers/footer of the Appendices section using VBA - I can do it by manual section and making it 'Same as Previous'. Also, sections following the Appendices section are changeable and be able to set to previous.

Firstly, how is a 'Back Cover Section' setup? Is there any way to get rid of it and make it just a standard section?
Secondly, is there anyway I can overwrite its headers/footers? Simply put, all sections in the document have the *same* header/footer content so making each next section as 'link to previous' should fix it but doesn't.

Code: Select all

Sub testResetHeadersFootersOfIONDocs()
    Call ResetHeadersFootersOfTheDoc(ActiveDocument)
End Sub

Function ResetHeadersFootersOfTheDoc(iDoc As Document)
'
' ResetHeadersFootersOfTheDoc
'
'
    Dim Rng As Range
    Dim i As Long
    
    For i = 2 To iDoc.Sections.Count
        With iDoc.Sections(i)
            .Headers(wdHeaderFooterFirstPage).LinkToPrevious = True
            .Headers(wdHeaderFooterPrimary).LinkToPrevious = True
            .Headers(wdHeaderFooterEvenPages).LinkToPrevious = True

            .Footers(wdHeaderFooterFirstPage).LinkToPrevious = True
            .Footers(wdHeaderFooterPrimary).LinkToPrevious = True
            .Footers(wdHeaderFooterEvenPages).LinkToPrevious = True
        End With
    Next i
End Function
Thanks.
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78464
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Link headers/footers to previous in BackCoverPage sectio

Post by HansV »

It looks like a content control...
Best wishes,
Hans

Robie
5StarLounger
Posts: 656
Joined: 18 Feb 2010, 14:26

Re: Link headers/footers to previous in BackCoverPage sectio

Post by Robie »

HansV wrote:It looks like a content control...
Thanks Hans. Interesting.

So, is it possible to remove the control temporarily, update the headers/footers and then restore it? Perhaps, is there a way to update the headers footers of a control section?

User avatar
HansV
Administrator
Posts: 78464
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Link headers/footers to previous in BackCoverPage sectio

Post by HansV »

I hope that someone else can help you with that, I never use content controls.
Best wishes,
Hans

Robie
5StarLounger
Posts: 656
Joined: 18 Feb 2010, 14:26

Re: Link headers/footers to previous in BackCoverPage sectio

Post by Robie »

HansV wrote:I hope that someone else can help you with that, I never use content controls.
Thanks Hans. I never used content control either ever so no wonder I was not even aware of it.