Share via

Replace the Headers and footers in a batch of Word files

Anonymous
2013-03-08T11:00:10+00:00

The problem;-

The header and footers in a large batch of Word files have to be changed.

The logo, and several pieces of text in each file's  header and footer needs to be changed.

I would like to replace the existing header and footer with a new replacement.

There are several hundered word file with an old header and old footer.

I do not want to change any other data or formatting in each of the target Word files, only the header and footer

So

Is there a macro that could replace the header and footer of a batch of word files , taking (copying, or reading ) the header

of a reference word file and inserting that header / footer into each of the traget files ?

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

6 answers

Sort by: Most helpful
  1. Anonymous
    2016-05-03T06:41:42+00:00

    Thank you

    1 person found this answer helpful.
    0 comments No comments
  2. Paul Edstein 82,861 Reputation points Volunteer Moderator
    2016-04-22T02:17:17+00:00
    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2016-04-22T01:25:08+00:00

    was this every achieved? does anyone have the code for this?

    1 person found this answer helpful.
    0 comments No comments
  4. Doug Robbins - MVP - Office Apps and Services 322.9K Reputation points MVP Volunteer Moderator
    2013-03-08T13:23:02+00:00

    Given that there is a logo involved, it might be better to create a template that has the new header and footer and then use a batch process to open each document and create a new document from the template and set the .Range.FormattedText of the new document to the .Range.FormattedText of the old document and then save the new document with a name such as that of the old document to which you append - updated and then close them both before going on to the next file.

    See thge code in the article "Find & ReplaceAll on a batch of documents in the same folder” at:

    http://www.word.mvps.org/FAQs/MacrosVBA/BatchFR.htm

    for how to set up a batch process

    1 person found this answer helpful.
    0 comments No comments
  5. Anonymous
    2013-03-08T16:28:36+00:00

    Hi, and thanks,

    Is there any risk of the method damaging or altering any formatting contained in the existing document ? by that I mean structure, styles, bullets, lists, positioning of figures, etc, etc ? 

    I'm concerned about such side effects. That's why I hope to get advice on a ..replace a header.... type solution.

    Thanks

    0 comments No comments