惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
A
About on SuperTechFans
J
Java Code Geeks
G
Google Developers Blog
L
LangChain Blog
小众软件
小众软件
宝玉的分享
宝玉的分享
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
博客园 - 【当耐特】
IT之家
IT之家
F
Fortinet All Blogs
aimingoo的专栏
aimingoo的专栏
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
博客园 - Franky
博客园_首页
雷峰网
雷峰网
Microsoft Security Blog
Microsoft Security Blog
Vercel News
Vercel News
B
Blog
月光博客
月光博客
酷 壳 – CoolShell
酷 壳 – CoolShell

博客园 - seamanhy

Android Studio 安装说明 Google——Tracking Code, Map Api ASP.NET输出到Excel - seamanhy - 博客园 GridView中BoundField重复绑定数据 一个等待的小功能 MS SQL 区分大小写 盗链 防止盗链 防止图片盗链 HTML编辑器 免费编辑器 中文免费HTML编辑器 URLReWriter ASP.NET 页面跳转 伪静态页面 多参数 一个免费的天气预报WebService 常用正则表达式 - seamanhy - 博客园 推荐一个SQL分页函数 一些网站中经常使用的插件 PNG24在IE6中不正常显示的问题 DataSet导入到Excel文件 Google拼音输入法字库分析程序 查看SQL Server 2000执行时间 SQL Server将字符串转换为多行 SQL Server将数据库中多行中的某个字段转换为字符串
VBSCRIPT控制网页打印页眉和页脚 - seamanhy - 博客园
seamanhy · 2010-03-31 · via 博客园 - seamanhy

代码

<meta content="EditPlus" name="Generator" />
<meta content="YC" name="Author" />
<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><table id="tb1" cellspacing="1" cellpadding="1" width="100%" align="center" border="2">
    
<tbody>
        
<tr>
            
<td><br />
            
<br />
            
<br />
            
<align="center"><input onclick="pagesetup_null()" type="button" value="Clean"> <input onclick="pagesetup_default()" type="button" value="Reset"><br />
            
</p>
            
</td>
        
</tr>
    
</tbody>
</table>