<html> <head> <title></title> <script language="javascript"> function printsetup() { //打印页面设置 wb.execwb(8,1); } function printpreview() { //打印页面预览 wb.execwb(7,1); } function printit() { if (confirm('确定打印吗?')) { wb.execwb(6,1) } } </script><script language=javascript> //浮动帧打印 function fudong() { var odoc=window.document; var r=odoc.body.createTextRange(); var stxt=r.htmlText; alert(stxt) var pwin=window.open("","print"); pwin.document.write(stxt); pwin.print(); } </script><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>
<title></title>
<script language="javascript">
function printsetup()
{
//打印页面设置
wb.execwb(8,1);
}
function printpreview()
{
//打印页面预览
wb.execwb(7,1);
}
function printit()
{
if (confirm('确定打印吗?'))
{
wb.execwb(6,1)
}
}
</script><script language=javascript>
//浮动帧打印
function fudong()
{
var odoc=window.document;
var r=odoc.body.createTextRange();
var stxt=r.htmlText;
alert(stxt)
var pwin=window.open("","print");
pwin.document.write(stxt);
pwin.print();
}
</script><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>
self.opener.close();
res://C:\WINNT\system32\shdoclc.dll/preview.dlg 出错:
'dialogArguments.__IE__PrintType' 为空或不是对象
//-------------------------------
up
{
// 打印页面预览
try
{
wb.ExecWB(7,2);
window.onfocus=function(){wb.ExecWB(45,1);}
window.opener=null;
}
catch(e)
{
window.close();
}
try{
window.close();
}
catch(e)
{
window.close();
}
}