当前位置: 首页 > 图文教程 > 网络编程 > ASP > WEB打印设置解决方案一

ASP
ASP+ACCESS实现的无限级目录树
ASP中字符串函数的应用
在VBScript中使用类(一)
在VBScript中使用类(二)
VS .net 2003调试javascript中两个杂症的解决
在VBScript中使用类(三)
如何在 dataGrid 上的第一列加上 CheckBox
在VBScript中使用类(四)
ASP.NET 的状态管理
用Asp写个加密和解密的类
网页制作 JSP与ASP 的比较
ASP.NET设计网络硬盘之两重要类
ASP:网上通讯簿1.00
ASP:Hack & Anti-Hack
ASP基本语法
ASP实用函数库
ASP进阶教程:给留言簿润下色
ASP进阶教程:数据库版本的留言簿
ASP进阶教程:留言簿自动发E-Mail
ASP进阶教程:留言查询功能(一)

ASP 中的 WEB打印设置解决方案一


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 32 ::
收藏到网摘: n/a

以下是IE打印设置脚本
 <script language="VBScript">
         Dim hkey_root,hkey_path,hkey_key

         hkey_root  = "HKEY_CURRENT_USER"
         hkey_path = "\Software\Microsoft\Internet Explorer\PageSetup"   //IE打印设置的注册表地址

         //设置修改函数
         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,""  //页脚

               hkey_key="\margin_left"
               RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"1"  //键值设定--左边边界

               hkey_key="\margin_top"
               RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"1" //键值设定--上边边界

               hkey_key="\margin_right"
               RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"1" //键值设定--右边边界

               hkey_key="\margin_bottom"
               RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"1" //键值设定--下边边界
         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>