Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Jan 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Creating Macro in header in Word 2007/2010

    I have a question about creating a macro in Word.
    My document has 500+ pages and a page number on each page in the header.
    I would like to replace the page numbers starting at number 400 with a different list of numbers. For example, I want to change page 400 to 408 and page 401 to page 423 etc. I have a list of page numbers that I want and which page numbers they are replacing.
    Can I create a macro to do this automatically?
    Thanks

  2. #2
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,055
    Thanks
    2
    Thanked 417 Times in 346 Posts
    Hi Maven,

    To do this, you're going to have to insert Section breaks before, and possibly after, each of the contiguous page ranges you want to change. Thus, you would need Section breaks before both pages 400 and 401, at least. The new Section headers would then need to be unlinked from the previous ones before you could do the re-numbering. And, if you have a multi-page Section to re-number sequentially, you'd also have to modify the page numbering field's 'staring from' number.

    Yes, it's all possible to do with a macro, but developing & testing one could take longer than doing the job manually.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  3. #3
    New Lounger
    Join Date
    Jan 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well actually I wanted to put in a symbol instead of a specific number. So my thinking was perhaps to have a list of symbols in the order I wish them to be, and have a macro choose them and replace where the number normally is positioned.
    I guess creating a new section might work, but that would be for numbers. What would I do if I did not want numbers, rather symbols? Can a macro be created for that?

  4. #4
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,055
    Thanks
    2
    Thanked 417 Times in 346 Posts
    Hi Maven,

    You would still need the Section breaks, as whatever you put into the header in one Section typically continues on every every page in that Section. If you put a symbol on page 401 without a preceding and following Section break - and unlinking the new Section headers - the symbol will also appear on pages 1-400 and on 402-500.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  5. #5
    WS Lounge VIP
    Join Date
    Mar 2006
    Location
    Maryland, USA
    Posts
    690
    Thanks
    17
    Thanked 66 Times in 56 Posts
    Any time you manually change the content of a header or footer, you must insert a section break before the changed header/footer and unlink it from the previous one.

    Pam

Posting Permissions

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