View Single Post
  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Stefan Blom Stefan Blom is offline
external usenet poster
 
Posts: 8,428
Default Print word document without header and footer

Well, you should be able to use a macro that formats header and footer
contents as hidden, prints the document, and then clears the formatting
again. The following is a simple version:

Sub PrintDocWithoutHeaderFooter()
Dim s As Section
For Each s In ActiveDocument.Sections
s.Headers(wdHeaderFooterEvenPages).Range.Font.Hidd en = True
s.Headers(wdHeaderFooterPrimary).Range.Font.Hidden = True
s.Headers(wdHeaderFooterPrimary).Range.Font.Hidden = True

s.Footers(wdHeaderFooterEvenPages).Range.Font.Hidd en = True
s.Footers(wdHeaderFooterFirstPage).Range.Font.Hidd en = True
s.Footers(wdHeaderFooterPrimary).Range.Font.Hidden = True
Next s

Options.PrintHiddenText = False

Dialogs(wdDialogFilePrint).Show

For Each s In ActiveDocument.Sections
s.Headers(wdHeaderFooterEvenPages).Range.Font.Hidd en = False
s.Headers(wdHeaderFooterPrimary).Range.Font.Hidden = False
s.Headers(wdHeaderFooterPrimary).Range.Font.Hidden = False

s.Footers(wdHeaderFooterEvenPages).Range.Font.Hidd en = False
s.Footers(wdHeaderFooterFirstPage).Range.Font.Hidd en = False
s.Footers(wdHeaderFooterPrimary).Range.Font.Hidden = False

Next s

End Sub

For instructions on how to attach the macro to a toolbar button (or to a
button on the QAT in Word 2007), see
http://www.gmayor.com/installing_macro.htm.

--
Stefan Blom
Microsoft Word MVP


"Lee" wrote in message
...
Thanks Stefan! Worked a treat! Simple solution. Is there another way where
you can just select a box etc to not print the the header and footer. This
will make it a lot easier for staff who have to print it.

Many thanks in anticipation.

Lee

"Stefan Blom" wrote:

Have you tried selecting the whole document and then printing the
selection?

--
Stefan Blom
Microsoft Word MVP


"Lee" wrote in message
...
Hiya
I have been looking all over the internet for the answer but have had
no
look.
We currently have a business letter head which we use for quotes etc...
The
quotes are sent out by email electronically with the heaer and footer
included. However, we print onto headed paper and would like the option
to
print without including the header and footer. Is there an option which
i
can
select in word to do this or is it a case of changing the code
somewhere.
Any help would be appreciated!
Regards
Lee