Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Jun 2002
    Location
    Durham, North Carolina, USA
    Posts
    140
    Thanks
    5
    Thanked 1 Time in 1 Post

    Turning off 'Same as Previous' for every header (Word XP)

    Hi everyone,

    Working on a long document with 45 sections, each alternating between portrait and landscape. Our docs require different headers for portrait and landscape sections, for which we provide a nice, easy macro. Idiot author didn't use the macro, and I now have 45 "Same as Previous" headers. Of course, before I start fixing them, I have to turn off "SAP". I'm sure someone's got some beautiful code already written to do this for every header. Can anyone help me out?

    TIA,

    Beej

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Turning off 'Same as Previous' for every header (Word XP)

    Try this:

    Sub UnlinkHeaders()
    Dim hdr As HeaderFooter
    Dim sec As Section
    For Each sec In ActiveDocument.Sections
    For Each hdr In sec.Headers
    If hdr.Exists Then
    hdr.LinkToPrevious = False
    End If
    Next hdr
    Next sec
    End Sub

  3. #3
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Turning off 'Same as Previous' for every header (Word XP)

    You may need to add onto the code that Hans provided to do the Footers as well. The SAP setting for the Header and Footer is independent of each other.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  4. #4
    2 Star Lounger
    Join Date
    Jun 2002
    Location
    Durham, North Carolina, USA
    Posts
    140
    Thanks
    5
    Thanked 1 Time in 1 Post

    Re: Turning off 'Same as Previous' for every header (Word XP)

    Thanks Guys. As always, you're a tremendous help!

    Beej

Posting Permissions

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