• Using fields to change Footer styles (Word 2002)

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » Using fields to change Footer styles (Word 2002)

    Author
    Topic
    #386479

    Greetings

    We have different styles for odd and even footers. But if a section break is inserted into a page I can wind up with a even page
    with a odd page footer style becouse the section number changes and the new page inherits that footer style.

    Now I can programmatically fix this but it means searching the footers everytime the number of pages changes.

    There’s got to be an easier way. I’ve looked at using fields in the hope of automatically setting either the odd or even style based on the page number in the footer itself.
    But I can’t figure out how to get a field to change the paragraph style rather than display a text message.

    Though I’ve done searchs related to fields,footers etc I’ve probably not searched for the right thing.
    Can anyone help me out with my lack of field/searching consciousness?

    Viewing 2 reply threads
    Author
    Replies
    • #670890

      Hi Frank:
      I’m sort of thinking out loud here (because it’s late at night & I don’t have the concentration to think it through). Suppose you set up your odd & even footers the same. Each would contain two IF fields. If the page number were odd, one field would be blank & the other would insert the text that you want using the * MERGEFORMAT switch to keep it’s formatting. The fields would be something like:

      { IF{ =MOD({ PAGE },2)}= 0 “” “Text goes here.” * MERGEFORMAT }{ IF{ =MOD({ PAGE },2)} 0 “” “Alternate Text goes here.” * MERGEFORMAT }

      Then again, maybe the CHARFORMAT switch would be better. It depends on the differences between the two styles. You might have to put the fields on different lines, so they each have their own paragraph mark. You could format the paragraph marks as hidden.

    • #670897

      Frank,

      I don’t understand exactly what your problem is, or why it is occurring, but I agree with Phil that, if at all possible, you should avoid using different styles for odd and even footers. It ought to be possible for someone with a good grasp of Word paragraph styles and their formatting to devise a Footer style that will accommodate both your odd and even footers. (I am thinking about things like appropriately positioned and formatted tabs and, if necessary, setting appropriate indents – positive or negative.) It is then a matter of creating the different odd and even footers with the various pieces of content preceded or separated by (the right number of) tabs. I am probably not making myself very clear, and it obviously depends on what sorts of things your odd and even footers are to contain.

      I am assuming (perhaps incorrectly) that the documents are being created using a template that contains the styles, page set-up (including the headers and footers) that are required. Naturally the Layout in the Page Setup is set with ‘Different odd and even’ checked under ‘Headers and footers’.

      If you are forced to stay with the different styles for odd and even footers you might consider this sort of approach:

      Create two AutoText entries – one for the odd footer and one for the even footer – making sure that each is styled with its appropriate odd or even footer style and that the paragraph mark is included in the AutoText entry. Then set up the odd and even footers so that each contains an AutoText field for its own AutoText entry.

      You say that the problem with the footers occurs when a section break is inserted in the document. This suggests that it is related to how the page set-up for the section following the break is being controlled. It may also relate to what sort of section break is being inserted. In my experience it’s all too easy get into a mess when the type of section break is anything other than ‘Next page’ or ‘Continuous’.

      I think I has better stop, before I ramble on too much, but I hope there is something here that may give you a useful idea.

    • #670905

      (Edited by macropod on 25-Apr-03 11:13. Simpler alternative solution added)

      Hi Frank,

      Changing the styles in a field is actually fairly straightforward, and requires only a minor change to the solution Phil posted. If you input the field as:
      {IF{=MOD({PAGE},2)}= 0 “” “Odd Page text goes here.
      “} {IF{=MOD({PAGE},2)}= 1 “” “Even Page text goes here.
      “}
      with a paragraph mark at the end of each of the first two lines, you can then apply the appropriate style to each footer by selecting the whole of each field in turn and applying the style to it. After you’ve done that, delete the space between the two field braces } { on the second line.

      An even simpler solution is to use a single field, thus:
      {IF{=MOD({PAGE},2)}= 0 “Even page text goes here.
      ” “Odd page text goes here.
      “}
      again with a paragraph mark at the end of each of the first two lines. You can then apply the appropriate style to each footer by selecting each of the text strings, including their para-marks, in turn and applying the style to it.

      Cheers

      PS: You might also need to minimise the size of the font and leading space for the trailing para mark (ie after the last brace)

      Cheers,
      Paul Edstein
      [Fmr MS MVP - Word]

      • #671901

        Greetings Phil, Robin and Skippy

        Thanks for your help guys but whilst I learned a lot about fields I couldn’t implement them without the need to open, delete or re-style
        something in the footer. My brief is to automate everything so the sponsor doesn’t require any advanced knowledge of Word to create
        a correctly styled/formatted document. So I’ve resorted to a function that allows the footers styles to be ‘flipped’ automatically.

        I’ll still work on a field solution when I’ve got the time but for now happy fielding and thanks

        Frank

        • #672013

          Frank:
          This may be too simplistic, but cannot your sponsor use Insert/Break/SectionBreak/OddPage when creating new sections (or a toolbar button to do same) so that sections will always start on an odd page, using the odd page footer?
          Tony.

          • #673502

            Tony,

            My apologies for the tardy reply, but the short answer is no.
            They expect that every possibility will be allowed for, and that the processes are automated so that they can concentrate
            on content rather than formatting.

            I have to admit that I don’t quite understand the how/why of the different section break types that cause me problems.
            But failing an elegant solution I’ll resort to a brute force solution if it works.

    Viewing 2 reply threads
    Reply To: Using fields to change Footer styles (Word 2002)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: