Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Oct 2002
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Headers and Footers Manipulation (English/Office 2000)

    Can anyone help? I am attempting to identify what type of Header I have in a particular Section, but seem to be going around in circles.

    I am analysing each Section individually, then trying to analyse the Header in each Section, depending on the Header option will dictate what I need to do with it. I have tried:

    If Activedocument.Section(1).Headers(wdHeaderFooterFi rstPage) Then
    If Activedocument.Section(1).Headers(wdHeaderFooterFi rstPage). Exists
    If Activedocument.Section(1).Headers(wdHeaderFooterFi rstPage).Index

    If I count the Headers in the Section, the value is 3 (which I can only presume is the Header options - wdHeaderFooterFirstPage, wdHeaderFooterPrimary and wdHeaderFooterEvenPages).

    Any help will be greatly appreciated.
    Thanks
    Jackie


    Thanks for any help.
    Jackie

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

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

    Re: Headers and Footers Manipulation (English/Office 2000)

    The middle one should yield the desired information. In a new document, I get the following results:

    <table border=1><td align=center>Expression</td><td align=center>Value</td><td>Activedocument.Section(1).Headers(wdHeaderFoot erPrimary).Exists</td><td>True</td><td>Activedocument.Section(1).Headers(wdHeaderFoot erFirstPage).Exists</td><td>False</td><td>Activedocument.Section(1).Headers(wdHeaderFoot erEvenPages).Exists</td><td>False</td></table>
    Even though Activedocument.Section(1).Headers.Count returns 3, only one of the three headers (the primary one) exists.

  4. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Headers and Footers Manipulation (English/Office 2000)

    I think the explanation for HansV's result is as follows:

    .Count indicates the maximum number of possible headers that can be defined in Page Setup

    .Exists tells you which headers have actually been set up in Page Setup (there is always at least one)

    And...

    .Range.Characters.Count > 1 tells you that header is not empty

  5. #4
    New Lounger
    Join Date
    Oct 2002
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Headers and Footers Manipulation (English/Office 2000)

    Many thanks for the help to yourself and Hans. I did eventually realise that the word "exists" was the key to all my problems. Can't believe I spent the whole day looking at this when it was such a simple solution.

    Regards
    Jackie

Posting Permissions

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