[求助] 用'WebBrowser' 对象来打印网页,如何将页眉页脚清空? 20050121 17:04:01

我使用'WebBrowser' 对象来打印网页,如何将页眉页脚清空?
有什么属性设置或方法调用吗?

谢谢啦!代码如下:

<object ID='WebBrowser' WIDTH=0 HEIGHT=0 CLASSID='CLSID:8856F961-340A-11D0-A96B-00C04FD705A2'></object>
</HEAD>
<BODY>
......
</BODY>
</HTML>
<script language='javascript'>
WebBrowser.ExecWB(7,1);
window.opener=null;
window.close();
</script>
----------------------------
2005-08-10 13:47:34

试试:
<script language="JavaScript">
var hkey_root,hkey_path,hkey_key
hkey_root="HKEY_CURRENT_USER"
hkey_path="\\Software\\Microsoft\\Internet Explorer\\PageSetup\\"
//设置网页打印的页眉页脚为空
function pagesetup_null(){
try{
var RegWsh = new ActiveXObject("WScript.Shell")
hkey_key="header"
RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"")
hkey_key="footer"
RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"")
}catch(e){}
}
</script>
<body onload=pagesetup_null()>
原文地址:https://www.cnblogs.com/huashanlin/p/482622.html