Reply
 
Thread Tools Display Modes
  #1   Report Post  
Yunus Yunus is offline
Junior Member
 
Posts: 0
Default Print without header & footer but keep spacing

I have a business letter head which we use for quotations. The quotes are sent out by email with the header and footer included. However, we print onto headed paper and would like the option to print without including the header and footer. I found the following code to create a macro from a previous thread:

Sub PrintDocWithoutHeaderFooter()
Dim s As Section
For Each s In ActiveDocument.Sections
s.Headers(wdHeaderFooterEvenPages).Range.Font.Hidd en = True
s.Headers(wdHeaderFooterFirstPage).Range.Font.Hidd en = 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(wdHeaderFooterFirstPage).Range.Font.Hidd en = 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

This works, however not only does it remove the header and footer but it also removes the spacing where the header and footer would have been. So if i print onto the headed paper then the text is printed over the headers and footers.

How can i modify the above coding to include this spacing? By the way, the first page has a different header & footer to the other pages and the last page has a different footer to the other pages.

Many thanks in advance for any help.
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Stefan Blom[_3_] Stefan Blom[_3_] is offline
external usenet poster
 
Posts: 6,897
Default Print without header & footer but keep spacing

One possibility is put the text in a text box (in the header and footer) and
then hide the text (but not the text box).

--
Stefan Blom
Microsoft Word MVP




"Yunus" wrote in message
...

I have a business letter head which we use for quotations. The quotes
are sent out by email with the header and footer included. However, we
print onto headed paper and would like the option to print without
including the header and footer. I found the following code to create a
macro from a previous thread:

Sub PrintDocWithoutHeaderFooter()
Dim s As Section
For Each s In ActiveDocument.Sections
s.Headers(wdHeaderFooterEvenPages).Range.Font.Hidd en = True
s.Headers(wdHeaderFooterFirstPage).Range.Font.Hidd en = 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(wdHeaderFooterFirstPage).Range.Font.Hidd en = 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

This works, however not only does it remove the header and footer but it
also removes the spacing where the header and footer would have been. So
if i print onto the headed paper then the text is printed over the
headers and footers.

How can i modify the above coding to include this spacing? By the way,
the first page has a different header & footer to the other pages and
the last page has a different footer to the other pages.

Many thanks in advance for any help.




--
Yunus


  #3   Report Post  
Yunus Yunus is offline
Junior Member
 
Posts: 0
Default

Thanks for the reply but I don't think that will work because the header/footers are images. Any other suggestions?
  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Stefan Blom[_3_] Stefan Blom[_3_] is offline
external usenet poster
 
Posts: 6,897
Default Print without header & footer but keep spacing

Use a macro to replace the image with a shape of the same size (solid white
background, no borders).

--
Stefan Blom
Microsoft Word MVP




"Yunus" wrote in message
...

Thanks for the reply but I don't think that will work because the
header/footers are images. Any other suggestions?




--
Yunus


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Header & Footer Spacing Office User[_2_] Microsoft Word Help 4 October 6th 09 07:01 PM
Header & Footer Saeed Page Layout 7 September 7th 09 04:15 PM
Page numbering for different pages & different header & footer shrinivas Page Layout 1 March 24th 07 02:44 PM
Header and Footer height and spacing from the top and bottom of a GordonM Page Layout 4 July 15th 06 01:39 AM
Keep spacing the same after header for both headings & paragraphs Jan T. Page Layout 1 March 27th 06 10:18 PM


All times are GMT +1. The time now is 03:25 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"