Please Note: This article is written for users of the following Microsoft Word versions: 97, 2000, 2002, and 2003. If you are using a later version (Word 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Word, click here: Deleting All Headers and Footers.

Deleting All Headers and Footers

by Allen Wyatt
(last updated September 14, 2018)


If you work with documents you receive from other people, one of the tasks you may routinely need to do is delete all the headers and footers in the documents. One way to do this is to simply select the various headers and footers and delete them, but if the document contains many sections, doing so can be very time consuming. (Particularly if you consider that each section can have up to three different headers and footers.)

Repetitious, time-consuming tasks are always a prime candidate for macros; this is no exception. The following macro will zip right through each section of a document, deleting all the headers and footers that have been defined.

Sub RemoveHeadAndFoot()
    Dim oSec As Section
    Dim oHead As HeaderFooter
    Dim oFoot As HeaderFooter

    For Each oSec In ActiveDocument.Sections
        For Each oHead In oSec.Headers
            If oHead.Exists Then oHead.Range.Delete
        Next oHead

        For Each oFoot In oSec.Footers
            If oFoot.Exists Then oFoot.Range.Delete
        Next oFoot
    Next oSec
End Sub

This macro is very powerful—it doesn't ask if you want to proceed, nor does it consider what may be included in the headers and footers. It simply deletes them all, leaving your document with none. If you regularly process quite a few documents, you can easily assign the macro to a toolbar button, menu item, or shortcut key.


If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (1777) applies to Microsoft Word 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Word (Word 2007 and later) here: Deleting All Headers and Footers.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...


Moving Quickly Between Directories

Want an easy way to move between directories using the Open dialog box? With just a little bit of up-front typing, you ...

Discover More

Hiding Gridlines

For those times when you remove the borders from your tables, Word provides a way that you can display non-printing ...

Discover More

Finding the Analysis ToolPak Add-In

The Analysis ToolPak is used to add some very handy capabilities to Excel. If you don't have it installed, and you can't ...

Discover More

The First and Last Word on Word! Bestselling For Dummies author Dan Gookin puts his usual fun and friendly candor back to work to show you how to navigate Word 2013. Spend more time working and less time trying to figure it all out! Check out Word 2013 For Dummies today!

More WordTips (menu)

Creating Page Footers and Headers

Headers and footers can add a final, professional touch to your printed document. Here's the quick way to add the headers ...

Discover More

Copying Headers and Footers

Need to get headers and footers from one document to another? You can use the steps in this tip to help make quick work ...

Discover More

Positioning Headers and Footers

Headers and footers can add a finishing touch to your printed documents. Here's how you can position those headers and ...

Discover More

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.


If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is six more than 1?

2021-05-26 12:42:37


Can i run this vba from excel to remove header in the word file???

2019-11-15 16:22:40


Awesome tip. Thanks

2017-02-14 10:33:02


This worked great for some of my documents, but now it is saying "Method 'Range' or Object 'HeaderFooter' failed"
Then it gives me the option to End or Debug, neither of which seem to do what I want.

Any idea as to what this might mean or what I could do about it?

2016-11-18 01:44:02


To prevent type mismatch 13 error, define oHead and oFoot as objects instead of HeaderFooter.

2016-10-20 16:59:10


deleting all the headers and footers that have been defined === defined??? where, how??? i ran it. no result.

2016-08-27 00:40:52


Really awesome! I have finished my work very easily within minutes for 1000 pages.

2015-03-27 03:48:01


Hi, Thanks for your Code. it's works Perfectly for all pages. i have to deleted footer for selected page. i have tried to achieve it but i can't. I Would really appreciate your help if you are able to do it for me

2014-06-23 00:57:12

Sally NZ

Thanks for the code but I only want to delete headers and footers on the first page. I tried to modify your code using:
the constant wdHeaderFooterFirstPage but I haven't got it right and can't get it to work.
Would appreciate your help if you are able to give it. Many thanks.

2013-04-19 13:56:43

George M Lee

The macro works great but it deletes my page numbers too. Any way to modify so the page numbers don't delete?

2013-02-21 18:17:39

Andrew Burt

Thanks for the code! I did find one small issue, namely if a header/footer has a text box in it, then your code doesn't catch it. I had a devil of a time figuring out how to delete those too. After some digging I found adding this--

Dim oShape As Shape

For Each oShape In oHead.Shapes
Next oShape

--inside each of your loops, above the "If oHead.Exists Then oHead.Range.Delete", line did the trick. (Likewise for 'foot')

Figured you might want to add that for completeness. Thanks!

2012-11-20 11:03:08


On which line do you get the error, Dom?

2012-11-20 10:53:20


This looks brilliant and exactly what I need. Unfortunately I get a Run time error '13': Type Mismatch

Any idea why this might be? I'm opening documents (Word 2003 & Word 2007) from Excel 2007 and running the macro from there.


2012-11-08 06:10:28


Works great!!! Good job.
Thank you very much

2012-07-22 07:35:14

João Carlos

Thank you so much!

2012-07-13 14:38:58


Desparately need to do this now on an important document but have never run a macro. How do I do this?

2012-01-09 11:43:33


It worked... Thanks!

This Site

Got a version of Word that uses the menu interface (Word 97, Word 2000, Word 2002, or Word 2003)? This site is for you! If you use a later version of Word, visit our WordTips site focusing on the ribbon interface.

Newest Tips

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.