I have been searching for several weeks now how best to approach something we have been asked to come up with and it seems that it should be simple but I have yet to find a suitable answer. I want to print from Sharepoint WSS 3 with the ability to add a custom header and footer without the default header and footer from IE. I had hoped that there would be a way to use C# code to do this, but I am just not finding anything that points me in the right direction. Is it possible to build a print function that will do this and if so, please point me to any examples that may be available.

3 Answers 3


I am nearly positive that this cannot be done in IE without the user altering the Page Setup. You may want to consider using a "Printable Version" link that simply redirects the user to a dynamically created PDF version of the content.


It sounds like you want one header and footer to display when someone is browsing a page, but you want a different header and footer to display when printing the page.

For this, I would recommend using CSS media types. This will instruct the browser to use one stylesheet when viewing and a different stylesheet when printing. Here is some more information: http://webdesign.about.com/cs/css/a/aa042103a.htm

  • Will these templates overwrite IE print templates. I thought that you would still get the annoying IE header/footer when using these. I will look into this in more depth. Thanks! Jun 29, 2010 at 12:27

Using CSS and Javascript you can grab the contents of a content container and send it to a new window with the additional content (header/footer) added. You should be able to build this into a Web Part that is deployed to the pages that require it.

  • I did look at this as an option, but it still prints through IE right? Jun 29, 2010 at 17:30
  • This method would print through IE Jun 29, 2010 at 18:46
  • What I meant was the default header and footer of IE would still show up on the print out and the requirement is that they do not. Jun 29, 2010 at 19:58
  • In the window.open() call you can control what gets displayed and what does not. You can turn off the toolbars, URL, etc. javascript-coder.com/window-popup/javascript-window-open.phtml Jun 29, 2010 at 20:43
  • I know how to do that part and thanks for the link to that. I think what I am missing is how this will allow the printing of my custom header/footer info without printing the IE header/footer info like the url and page x of y in our intranet. You are being extremely helpful which I do appreciate. Jun 29, 2010 at 21:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.