本人是用js写,代码如下:
function PageSetup_Null() {
try {
var Wsh = new ActiveXObject("WScript.Shell");
HKEY_Key = "header";
//设置页眉(为空)
Wsh.RegWrite(HKEY_Root + HKEY_Path + HKEY_Key, "");
HKEY_Key = "footer";
//设置页脚(为空)
Wsh.RegWrite(HKEY_Root + HKEY_Path + HKEY_Key, "");
HKEY_Key = "margin_bottom";
//设置下页边距(0)
Wsh.RegWrite(HKEY_Root + HKEY_Path + HKEY_Key, "0");
HKEY_Key = "margin_left";
//设置左页边距(0)
Wsh.RegWrite(HKEY_Root + HKEY_Path + HKEY_Key, "0");
HKEY_Key = "margin_right";
//设置右页边距(0)
Wsh.RegWrite(HKEY_Root + HKEY_Path + HKEY_Key, "0");
HKEY_Key = "margin_top";
//设置上页边距(8)
Wsh.RegWrite(HKEY_Root + HKEY_Path + HKEY_Key, "8");
} catch(e) {
alert("不允许ActiveX控件");
}
}
ActiveXObject("WScript.Shell");这个对象无效,网上的方法我都试过了,都无效