如何让IE打印网页的时候不打印每页头尾的那些信息

weaveph 2003-08-05 12:31:47
就是不然让它打印页首的“页码,1/1”和页尾的“file://c:\docume~1\.....”。
而只打印正式的网页页面。

能有办法吗?
...全文
284 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
weaveph 2003-08-05
  • 打赏
  • 举报
回复
谢谢yhp(农场主)兄,呵呵
yhp 2003-08-05
  • 打赏
  • 举报
回复
别忘了给分哦
yhp 2003-08-05
  • 打赏
  • 举报
回复
给段代码给你
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="YC">
<script language="VBScript">
dim hkey_root,hkey_path,hkey_key
hkey_root="HKEY_CURRENT_USER"
hkey_path="\Software\Microsoft\Internet Explorer\PageSetup"
'//设置网页打印的页眉页脚为空
function pagesetup_null()
on error resume next
Set RegWsh = CreateObject("WScript.Shell")
hkey_key="\header"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,""
hkey_key="\footer"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,""
end function
'//设置网页打印的页眉页脚为默认值
function pagesetup_default()
on error resume next
Set RegWsh = CreateObject("WScript.Shell")
hkey_key="\header"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"&w&b页码,&p/&P"
hkey_key="\footer"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"&u&b&d"
end function
</script>
</HEAD>

<BODY>
<br>
<br>
<br>
<br>
<br>
<br><p align=center>
<input type="button" value="清空页码" onclick=pagesetup_null()> <input type="button" value="恢复页吗" onclick=pagesetup_default()><br>

</p>
</BODY>
</HTML>
wanghekun 2003-08-05
  • 打赏
  • 举报
回复
这个不是在网页里设置的,是在打印机的选项里设置的

87,988

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧