How to print word document without header and footer?

To print a Word document without headers and footers, you can use the following VBA code:

  1. Press ALT + F11 to open the Microsoft Visual Basic for Applications window.
  2. Click Insert > Module, then copy and paste the following code into the empty module:

Sub PrintDocWithoutHeaderFooter()
Call SetHeaderAndFooter(True)
Options.PrintHiddenText = False
Call SetHeaderAndFooter(False)
End Sub

Sub SetHeaderAndFooter(xBool As Boolean)
Dim xSection As Section
For Each xSection In ActiveDocument.Sections
xSection.Headers(wdHeaderFooterEvenPages).Range.Font.Hidden = xBool
xSection.Headers(wdHeaderFooterFirstPage).Range.Font.Hidden = xBool
xSection.Headers(wdHeaderFooterPrimary).Range.Font.Hidden = xBool
xSection.Footers(wdHeaderFooterEvenPages).Range.Font.Hidden = xBool
xSection.Footers(wdHeaderFooterFirstPage).Range.Font.Hidden = xBool
xSection.Footers(wdHeaderFooterPrimary).Range.Font.Hidden = xBool
Next xSection
End Sub

  1. After inserting the code, press F5 to run the code. The Print dialog will appear, and you can configure the print settings according to your needs, as shown in the image below:
How to print word document without header and footer

How to print word document without header and footer

  1. Click OK to start printing, and the document will be printed without headers and footers.
Compare items
  • Total (0)
Shopping cart