Changing headers and footers for Multiple Word Docs

  • Thread starter Heading for problems
  • Start date
H

Heading for problems

I have around 30,000 word docs and need to change the headers and footers for
them all. As I could not figure out a way to automate this using MS Office I
searched for some software. When I tested the software it worked but would
only change the header and footer on the first page and not the rest. It
would seem that the default setting for all 30,000 docs was to have different
first page selected for the headers and footers. Does anybody know a way to
change that setting in all my docs so the software will work? Or does anybody
know of a solution to my problem?
 
D

Doug Robbins - Word MVP on news.microsoft.com

To access all of the headers and all of the footers in all of the sections
of a document, you would use

Dim i As Long, j As Long
With ActiveDocument
For i = 1 To .Sections.Count
With .Sections(i)
For j = 1 To .Headers.Count
.Headers(j).Range.Text = "some new text"
Next j
For j = 1 To .Footers.Count
.Footers(j).Range.Text = "some new text"
Next j
End With
Next i
End With

However, see the following articles:

"Find & ReplaceAll on a batch of documents in the same folder" at:

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

"Using a macro to replace text where ever it appears in a document including
Headers, Footers, Textboxes, etc." at:

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




--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
H

Heading for problems

Thanks for the help but that is way beyond my ability. I do not have a clue
what any of means .. I was kind of hoping I could click a button! hehe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top