Printing documents without their headers and footers

  • Thread starter Thread starter Flip
  • Start date Start date
F

Flip

Hello all,
Some3 or 4 years ago maybe, I have seen an article on this subject. I think
this was on a website of one of the MVP's. I cannot find it anymore.
Can somebody help?
Ofcourse I am looking for a smart way to do just that.
Flip
 
You could use a macro containing the following code:

Dim i As Long, j As Long
With ActiveDocument
UndoClear
For i = 1 To .Sections.Count
With .Sections(i)
For j = 1 To .Headers.Count
.Headers(j).Range.Delete
Next j
For j = 1 To .Footers.Count
.Footers(j).Range.Delete
Next j
End With
Next i
.PrintOut
Do While .Undo = True
.Undo
Loop
End With


--
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
 
Great!
Thanks Doug.
Flip


Doug Robbins - Word MVP said:
You could use a macro containing the following code:

Dim i As Long, j As Long
With ActiveDocument
UndoClear
For i = 1 To .Sections.Count
With .Sections(i)
For j = 1 To .Headers.Count
.Headers(j).Range.Delete
Next j
For j = 1 To .Footers.Count
.Footers(j).Range.Delete
Next j
End With
Next i
.PrintOut
Do While .Undo = True
.Undo
Loop
End With


--
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
 
Back
Top