可以手动在IE里设置,也可以使用scriptX用代码控制
解决方案 »
- 谁能指导我“关于打印报表”的具体方法? 急急急!!
- js一段代码 在线等!!!
- 求MSDN Web Development的chm下载地址
- 急,二进制数据问题
- BS开发的 好东西 不敢独享 <<BS系统开发核心技术资料大全>> 免费提供大家下栽 下载资料大全 还要 免费送分啊.,哈哈哈
- 义务提供JavaScript的函数集!!!
- javaScropt如何通过Microsoft.XMLDOM来解析XML
- 关于如何把一个页面中的javascript数组传到另一个javascript中的数组变量中去?
- 为什么以下函数在IE5。01以下版本都不能正常运行?????
- 微信JS SDK 怎么预览本地图片
- 怎么判断一个用embed嵌入的媒体文件正在播放?
- 如何能自动发出回车消息?
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>
xxxxxxxxxxx<br>
yyyyyyyyyyyyyy<br>
kkkkkkkkkkkk<br><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){}
}// 设置页眉页脚为默认值
function PageSetup_Default()
{
try{
var RegWsh = new ActiveXObject("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") ;
}
catch(e){}
}// 打印
function PrintPage()
{
PageSetup_Null() ;
window.print() ;
PageSetup_Default() ;
}</Script>
<a href="#" onClick="PrintPage();">Print Page</a>