Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in


How to print word document without header and footer? 

If there are header and footer in your Word document, when printing this document, the header and footer will be printed as well by default. But, sometimes, you needn’t the header and footer to be printed . In this case, the method in this article may help you.

Print Word document without header and footer by using VBA code

Print Word document without header and footer by using VBA code

To print the Word file without header and footer, the following VBA code can do you a favor, please do as this:

1. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.

2. And then, click Insert > Module, copy and paste below code into the opened blank module:

VBA code:Print Word document without header and footer:

Sub PrintDocWithoutHeaderFooter()
    Call SetHeaderAndFooter(True)
    Options.PrintHiddenText = False
    Call SetHeaderAndFooter(False)
End Sub
Sub SetHeaderAndFooter(xBool As Boolean)
    Dim xSel As Selection
    For Each s In ActiveDocument.Sections
        s.Headers(wdHeaderFooterEvenPages).Range.Font.Hidden = xBool
        s.Headers(wdHeaderFooterFirstPage).Range.Font.Hidden = xBool
        s.Headers(wdHeaderFooterPrimary).Range.Font.Hidden = xBool
        s.Footers(wdHeaderFooterEvenPages).Range.Font.Hidden = xBool
        s.Footers(wdHeaderFooterFirstPage).Range.Font.Hidden = xBool
        s.Footers(wdHeaderFooterPrimary).Range.Font.Hidden = xBool
    Next s
End Sub

3. After inserting the above code, please press F5 key to run it, and a Print dialog box will be popped out, then you should configure the print settings to your need, see screenshot:

doc print without header footer 1

4. And then, click OK to start printing, the document will be printed without the header and footer at once.

Recommended Productivity Tools

shot kutools word kutools tab 1180x121
shot kutools word kutools plus tab 1180x120

Kutools For Word - More Than 100 Advanced Features For Microsoft Word, Save Your 60% Time

  • Complicated and repeated operations can be done a one-time processing in seconds.
  • Insert multiple images across folders into Word document at once.
  • Merge and combine multiple Word files across folders in to one with your desired order.
  • Split the current document into separate documents according to heading 1, section break or other criteria.
  • Convert files between Doc and Docx, Docx and PDF, collection of tools for common conversions and selection, and so on...


Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.

Be the first to comment.