VBSCRIPT控制网页打印页眉和页脚
2010-03-31 15:31
447 查看
代码
<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 />
<p align="center"><input onclick="pagesetup_null()" type="button" value="Clean"> <input onclick="pagesetup_default()" type="button" value="Reset"><br />
</p>
</td>
</tr>
</tbody>
</table>
<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 />
<p align="center"><input onclick="pagesetup_null()" type="button" value="Clean"> <input onclick="pagesetup_default()" type="button" value="Reset"><br />
</p>
</td>
</tr>
</tbody>
</table>
相关文章推荐
- HTML网页打印去掉页眉页脚,以及如何控制不想打印出的页面元素【梨城在线】
- JavaScript实现网页打印,可设置页眉、页脚、页边距
- 打印网页时怎么去掉页眉页脚
- 网页局部打印,并且去除页眉页脚
- 打印网页时怎么去掉页眉页脚
- JAVASCRIPT实现网页打印,可设置页眉、页脚、页边距
- 通过javascript设置打印网页时去掉页眉页脚
- JS 网页打印 页边距 页眉页脚
- [求助] 用'WebBrowser' 对象来打印网页,如何将页眉页脚清空? 2005-01-21 17:04:01
- js 设置网页打印的页眉页脚和页边距
- 如何控制IE打印中页眉和页脚
- 网页打印中页眉和页脚的问题
- JS 网页打印 页边距 页眉页脚
- 设置网页打印的页眉页脚
- 打印网页时怎么去掉页眉页脚
- 网页打印时去除页眉页脚(Removing Header&Footer when printing page)
- asp.net 修改注册表,清空网页打印的页眉页脚
- 网页打印设置+自带的打印预览+去掉打印时的页眉页脚+屏蔽打印
- 打印网页去掉页眉和页脚
- 网页打印设置,页眉页脚的设置