Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting rid of header/footer 4

Status
Not open for further replies.

WhiteTiger

Programmer
Jun 26, 2001
605
US
Whenever I print in IE 5, I get these stupid headers + footers...


Invoice Fax Transmittel Page 1 of 1 at the top (that's the name of the page)

and (the location of the document.)

HOW in the world can I get rid of these STUPID things?...its for intranet forms were using to help speed things up...you can select project # and it fills out all the information for you...=) Regards,
Anth:cool:ny
----------------------------------------
"You say [red]insanity[/red] like it's a BAD THING!"
 
Manually:
File>>Page Setup
Delete the text from the Header and Footer fields...

With Code:
<script type=&quot;text/vbscript&quot;>
Dim WSHShell
Set WSHShell = CreateObject(&quot;WScript.Shell&quot;)
WSHShell.RegWrite &quot;HKCU\Software\Microsoft\Internet Explorer\PageSetup\header&quot;, &quot;&quot;
WSHShell.RegWrite &quot;HKCU\Software\Microsoft\Internet Explorer\PageSetup\footer&quot;, &quot;&quot;
</script>
 
Why thank you...that was a lot quicker response and just what I was looking for...compaired to last time I asked this question...=) Regards,
Anth:cool:ny
----------------------------------------
&quot;You say [red]insanity[/red] like it's a BAD THING!&quot;
 
Hi guys does anyone know the CSS code for changing the border style and border color of drop down menus?i.e.
the <select class=changebordertye>

All IE seems to allow me to change is the background color.

I've tried everything and searched the net over for the code. I guess it does't just exist!

Any help would be appreciated

Thanks in advance
JOhn.
 
Ok, is there any way to do this and set it back after I print?...I want it to disable these headers before I print, then set them back afterwards...right now I'm doing it by going to other pages, etc...and setting it back, but I want to be able to put this on other places and not have to worry about a ton of code. Regards,
Anth:cool:ny
----------------------------------------
&quot;You say [red]insanity[/red] like it's a BAD THING!&quot;
 
Hi,

Can anyone help me with the post from aperfectcircle... I placed the code in my asp page and I still get the headers and footers. Will this regkey exist in the same location always?

Any ideas??

Regards,

MDA
---------------------------------------------------
With Code:
<script type=&quot;text/vbscript&quot;>
Dim WSHShell
Set WSHShell = CreateObject(&quot;WScript.Shell&quot;)
WSHShell.RegWrite &quot;HKCU\Software\Microsoft\Internet Explorer\PageSetup\header&quot;, &quot;&quot;
WSHShell.RegWrite &quot;HKCU\Software\Microsoft\Internet Explorer\PageSetup\footer&quot;, &quot;&quot;
</script>

--------------------------------------------------
 
If you are talking about what I think you are talking about, just earse the commands in the Header and Footer section of the PAGE SET-UP option from the file menu.

Try that.
 
I just used it in my app and it worked perfectly. I put the Script section above the <BODY> tag and had no problems with it. Because it is an ActiveX control, you may need to change the security settings in the browser: Tools, Internet Options, Security, Custom Level --> Under the ActiveX controls, make sure they are marked for Prompt or Enable. I mark mine for Prompt. This allows me to make sure that only the scripts I want to run get run and helps avoid running virus scripts automatically.


<script Language = &quot;vbscript&quot;>
Dim WSHShell
Set WSHShell = CreateObject(&quot;WScript.Shell&quot;)
WSHShell.RegWrite &quot;HKCU\Software\Microsoft\Internet Explorer\PageSetup\header&quot;, &quot;&quot;
WSHShell.RegWrite &quot;HKCU\Software\Microsoft\Internet Explorer\PageSetup\footer&quot;, &quot;&quot;

Sub ResetHeader()
Dim WSHShell
Set WSHShell = CreateObject(&quot;WScript.Shell&quot;)
WSHShell.RegWrite &quot;HKCU\Software\Microsoft\Internet Explorer\PageSetup\header&quot;, &quot;&w&bPage &p of &P&quot;
WSHShell.RegWrite &quot;HKCU\Software\Microsoft\Internet Explorer\PageSetup\footer&quot;, &quot;&u&b&d&quot;
End Sub

</script>

<A HREF=&quot;switchboard.asp&quot; OnClick=ResetHeader()>Return To Switchboard</A>

I added the code in red and put a link (blue text) on the bottom of the page and when the user clicks it to go to the next page, it calls the ResetHeader function which resets the header and footer back to the default.

I am using IE6. I don't know if it will work with Netscape, but luckily everyone using my app is on IE.

Thanks to aperfectcircle for the original code!

TwoOdd
--------------
Good judgment comes from experience, and experience comes from bad judgment.
-- Barry LePatner
 
umm this thread is over 2 years old! but at least we know someone is using the search feature rather that asking the question without doing leg work

Kudos to you man!

<signature>
sometime you just gotta say &quot;WHAT THE @#*% !!&quot;
</signature>
 
Thanks,

I figured I wasn't the only one trying to get rid of the headers and footers dynamically. I'm glad someone else already had the answer.

TwoOdd
--------------
Good judgment comes from experience, and experience comes from bad judgment.
-- Barry LePatner
 
With TwoOdd's post... what if the user had their headers and footers set to something other than a header of &quot;&w&bPage &p of &P&quot; and a footer of &quot;&u&b&d&quot;? Wouldn't the user be a bit annoyed at having them &quot;reset&quot; to something different? :)
 
I'm doing a project right now that I need to control some of the print attributes, including header and footer, and I'm using the free version of ScriptX ( It's a plugin (? I don't know if that is the precise term) for IE that can be installed automatically if required, and accessed by an object in the script of the page. So far it is working very nicely for me. It will let you control the margins, header/footer, page orientation, and maybe a couple other things, and everything is reset when the document is closed. (The licensed version allows way more control, but is out of my price range.) Thought I'd throw in this comment in case someone else uses the search feature on the forum. :)
 
That sounds excellent. I will definately be checking that out. Thanks OsakaWebbie!
 
I just used the script to fix my problem.. works like a treat. I am going to give you another star because I have been trying to fix that problem for ages.

Thanks so much, OsakaWebbie.
 
Thanks OsakaWebbie!!!!!!!!!!!! I have been searching and searching for a solution to this problem. I downloaded scriptx this morning, and within 10 minutes, my headers and footers were gone! It would be great if this solution could be posted in the FAQ section because it seems like there's a lot of people out there trying to figure out how to do the same thing.

Again, many many thanks. Hollander.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top