主要是解決在使用WebBrowser打印時(shí),得先設(shè)置IE安全性的問(wèn)題,是客戶端工具。
代碼如下:
'/*=========================================================================
' * Intro 主要是解決在使用WebBrowser打印時(shí),得先設(shè)置IE安全性的問(wèn)題
' * FileName 添加網(wǎng)站到安全站點(diǎn).設(shè)置安全站點(diǎn)打開(kāi)ActiveX時(shí)提示.去頁(yè)眉頁(yè)腳.vbs
' * Author yongfa365
' * Version v1.0
' * Email yongfa365[at]qq.com
' * MadeTime 2009-06-18 23:12:55
' * LastModify 2009-06-18 23:12:55
' *==========================================================================*/
Const HKEY_CURRENT_USER = &H80000001
Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
'添加網(wǎng)站到安全站點(diǎn)
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\yongfa365.com"
objReg.CreateKey HKEY_CURRENT_USER, strKeyPath
objReg.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, "http", 2
'設(shè)置安全站點(diǎn)打開(kāi)ActiveX時(shí)提示
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2"
objReg.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, "CurrentLevel", "00000000"
objReg.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, "1201", "00000001"
'取消頁(yè)眉頁(yè)腳
strKeyPath = "Software\Microsoft\Internet Explorer\PageSetup\"
objReg.SetStringValue HKEY_CURRENT_USER, strKeyPath, "header", ""
objReg.SetStringValue HKEY_CURRENT_USER, strKeyPath, "footer", ""
msg = "IE安全設(shè)置完成"&vbCrLf&vbCrLf
msg = msg & "如果還不能正常打印,你需要關(guān)閉所有打開(kāi)的IE瀏覽器窗口,然后再登錄OA進(jìn)行打印"&vbCrLf&vbCrLf
msg = msg & "如果還是有問(wèn)題,您可以聯(lián)系技術(shù)組:柳永法 "
MsgBox msg, vbInformation, "溫馨提醒!"