Results 1 to 11 of 11
  1. #1
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    First page Header when only one page? (Word97SR2 et al?)

    Please can anyone confirm the veracity: "It is impossible to set up a header for any page other than the first page when there is only one page in the document."?

    I have placed myself in a situation where I want to create a new document (easy!) and anticipate user's requirements by setting in place one header for the first page, and a second header for all other pages, as in "File, Page setup, Layout, Different First Page". However, the user has not yet had opportunity to enter any text, so the document is empty.

    Setting up that second header is easy enough to do when the document already has overflowed the first page, but as far as I can see there is no way that one can prepare for that second header until such time as there is a page 2, no matter how that page 2 is created.

    See also: first page header
    See also: wdSeekFirstPageHeader

    (later) having typed thus far, I wondered whether I could fool MSWord (again) by creating a second page, installing the second header, and then deleting the second page. Gimme a couple of minutes .....

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: First page Header when only one page? (Word97SR2 et al?)

    Yes it appears to be so.

    The attached NotePad file contains an ugly macro, recorded in haste and not cleaned up at all.


    Open a new document and run the macro. The macro inserts a page break (now we have two pages), sets "different first page", sets the header2 for page 2, sets the header1 for page 1 and terminates.

    So far so good. We have a near-empty document with visibly distinct page headers.


    Now you have to ctrl-A and delete to clear all text, especially the page break, and then hold down the enter key until you spill over from page 1 to page2.


    Bingo! Distinct headers from an empty document.



    Duh. Word can do it, but doesn't want to admit it?



    OK. if you give this a try and it works for you, please confirm, especially in anything past Word97SR2. Thanks.
    Attached Files Attached Files

  3. #3
    3 Star Lounger
    Join Date
    Jun 2001
    Location
    Los Angeles, California, USA
    Posts
    289
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: First page Header when only one page? (Word97SR2 et al?)

    Yup, this is the only way I could figure out to do it myself. Add page, then delete page -- headers and footers remain intact.

  4. #4
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: First page Header when only one page? (Word97SR2 et al?)

    Hi Chris:
    Nope, you can do it. I don't know how to do it with VBA, but all you do is open a template, create a "normal" header & footer, THEN go to File/Page Setup.../Layout/Headers & Footers/ & tick the "different first page". Ta-da. You're done. Saves a step.

    Cheers,

  5. #5
    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: First page Header when only one page? (Word97SR2 et al?)

    As long as we're getting ugly, I still use this code:

    <pre>ActiveWindow.View.Type = wdNormalView
    WordBasic.NormalViewHeaderArea 'Should place insertion point in p2 header;
    'if both 1st pg diff and odd/even are on, will be in the wrong place
    With Selection
    various and sundry
    End With
    WordBasic.ClosePane</pre>


  6. #6
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: First page Header when only one page? (Word97SR2 et al?)

    > You're done. Saves a step.

    Yabbut (I'm sounding more lake (sic) a Canadian every day, eh?) have you actually set up the headers (or footers). It seems to me that all you've done in the above is set the switch that allows different headers. You haven't actually set them up.

    If, after following your steps, you tap the Enter key 70 times, do you see different text at the head of each page?

  7. #7
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: First page Header when only one page? (Word97SR2 et al?)

    > WordBasic.

    Don't tell me about ugly ........(grin)


    I agree. The code I posted was recorded and was meant only to demonstrate in principle that it can be done. I wanted to correct my initial posting before anyone got carried away.

    Since then I have a much neater more satisfying solution (attached as Word97 DOCument)
    Attached Files Attached Files

  8. #8
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: First page Header when only one page? (Word97SR2 et al?)

    > Add page, then delete page

    Thanks Van. It is such a peculiar feeling to "get inside the head' of MS products, to realise that the two headers have a storage place within the Word document, but that that storage space is available only by having two pages.

    The code in MSWord must run something like this:
    <pre>' User wants to create the other header
    If NumberOfPages > 1 then
    ' Go ahead. Seems valid to me
    Else
    ' Don't do it. How can you have two headers when there's only one page? Duh!
    ' I wish I were allowed to generate a really mean syntax error over this.
    ' I've got the world's stupidest user on my hands .....
    Endif
    </pre>


  9. #9
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: First page Header when only one page? (Word97SR2 et al?)

    Hi Chris:
    You still have to set up both headers. The step you save is not having to create & then delete a page. If yu set up different first page header & then the regular header, you can only do so by first creating the extra page. However, if you:
    1. Set up the regular header.
    2. Go to File/Page Setup.../Layout tab & tick "different first page".
    3. Go to View/Headers & Footers & set up the first page header.

    You don't have to create & then delete a 2nd page.

    Cheers,

  10. #10
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,049
    Thanks
    124
    Thanked 119 Times in 116 Posts

    Re: First page Header when only one page? (Word97SR2 et al?)

    Hi Chris,

    Not so. You can manually (or with VBA) edit all of the headers/footers a section can have from the first page of that section.

    Set your page layout to have different first page unchecked. You can then set the "header" and "footer." When you then check "different first page" those will disappear and you will be able to set the "first page header" and "first page footer." Your previous settings are now for all other pages.

    You can do similar things with different even/odd. I believe that the "header" and "footer" become the even page headers/footers.

    Generally, though, I just insert a hard page break, make the changes, close the header/footer view, and delete the page break.

    Finally, in most of my templates, I have a header/footer that requires no editing. It grabs its information from what is typed on the first page using StyleRef fields. For examples of this, take a look at the StyleRef Field Tutorial and the Letterhead Textboxes and Styles tutorial downloadable from the same page.

    By doing this, I avoid the embarrassment of having a letter go out with one date (corrected) on page one and a different date (the original createdate) in the headers/footers or having the name of a different client or irrelevant subject in left-over headers footers that someone (me) forgot to check. It works very well for me.
    Charles Kyle Kenyon
    Madison, Wisconsin

  11. #11
    3 Star Lounger
    Join Date
    Jun 2001
    Location
    Los Angeles, California, USA
    Posts
    289
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: First page Header when only one page? (Word97SR2 et al?)

    Great! Thanks Chris and Charles.
    <hr>Set your page layout to have different first page unchecked. You can then set the "header" and "footer." When you then check "different first page" those will disappear and you will be able to set the "first page header" and "first page footer." Your previous settings are now for all other pages.<hr>
    So simple. Of course you have to do it backwards. This isn't WordPerfect. What was I thinking? I always tried to set the First Page Header/Footer info first, then Show Next didn't. Where's the "enlightenment" smily?
    <hr>Generally, though, I just insert a hard page break, make the changes, close the header/footer view, and delete the page break.<hr>
    Me too, but I'm glad now that I don't have to.

    Thanks.

Posting Permissions

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