Microsoft Word
--
Questions
--
Followers
Top Experts
I am looking for a solution that will either remove all of the section/header/footer designations so i can create my own global header/footer
or
A way of creating a header/footer that will override the section ones.
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
Sub RePaginate()
'macro by brian balster 20030821
'go to the beginging of the document and find first header
Selection.HomeKey unit:=wdStory
ActiveWindow.View.SeekView
'loop through all pages on document
Do
'find the next page's header and delete it
Selection.WholeStory
Selection.Delete
If Selection.Information(wdAc
Selection.Information(wdNu
Exit Do
Else
'goto next page's header
ActiveWindow.View.NextHead
End If
Loop While Selection.Information(wdAc
Selection.Information(wdNu
'now do footers
ActiveWindow.View.SeekView
Selection.HomeKey unit:=wdStory
ActiveWindow.View.SeekView
'loop through all pages on document
Do
'find the next page's header and delete it
Selection.WholeStory
Selection.Delete
If Selection.Information(wdAc
Selection.Information(wdNu
Exit Do
Else
'goto next page's header
ActiveWindow.View.NextHead
End If
Loop While Selection.Information(wdAc
Selection.Information(wdNu
'now we're done
ActiveWindow.View.SeekView
MsgBox "Your document has had its headers and footers removed" & vbCr & _
"Save to keep changes, don't save to don't :)"
End Sub
You can do this manually with the 'Header and Footer'. View/Header and Footer and click on the 'Link to Previous' button.
Note that, depending on the settings for 'Header and footer' in the Page Setup for each section' you can have up to three different headers and footers for each section.
If you like, you can simply run this macro.
After that a change that you make in any section's header or footer will be reflected in all the others.






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
When I run this macro, I get 2 errors.
Microsoft Visual Basic
Run-time error '28'; Out of Stack space
then, when I debug, it stops at the first occurrence of 'Selection.Delete'

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
Microsoft Word
--
Questions
--
Followers
Top Experts
Microsoft Word is a commercial document editing program that is part of the Microsoft Office suite. It features numerous text-editing tools for creating richly formatted documents, along with tools for the use of macros in Word documents. Word's native file formats are denoted either by a .doc or .docx file extension. Plugins permitting the Windows versions of Word to read and write formats it does not natively support, such as the OpenDocument format (ODF) are available. Word can import and display images in common bitmap formats such as JPG and GIF. It can also be used to create and display simple line-art.