Y
Yunus
I have a business letter head which we use for quotations. The quote
are sent out by email with the header and footer included. However, w
print onto headed paper and would like the option to print withou
including the header and footer. I found the following code to create
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 i
also removes the spacing where the header and footer would have been. S
if i print onto the headed paper then the text is printed over th
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 an
the last page has a different footer to the other pages.
Many thanks in advance for any help
are sent out by email with the header and footer included. However, w
print onto headed paper and would like the option to print withou
including the header and footer. I found the following code to create
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 i
also removes the spacing where the header and footer would have been. S
if i print onto the headed paper then the text is printed over th
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 an
the last page has a different footer to the other pages.
Many thanks in advance for any help