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

推荐订阅源

爱范儿
爱范儿
WordPress大学
WordPress大学
C
Check Point Blog
GbyAI
GbyAI
U
Unit 42
Google DeepMind News
Google DeepMind News
B
Blog RSS Feed
Blog — PlanetScale
Blog — PlanetScale
J
Java Code Geeks
I
InfoQ
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Hugging Face - Blog
Hugging Face - Blog
Vercel News
Vercel News
博客园 - 【当耐特】
美团技术团队
小众软件
小众软件
S
SegmentFault 最新的问题
Jina AI
Jina AI
阮一峰的网络日志
阮一峰的网络日志
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The Cloudflare Blog
Last Week in AI
Last Week in AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Visual Studio Blog

博客园 - 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>