Copy Code code as follows:
'/*=========================================================================
' * Intro is mainly to solve the problem when using WebBrowser to print, IE security must be set first
' * FileName adds site to secure site. Set the security site to open ActiveX prompt. Go to the header footer. 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")
' Add a site to a secure site
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
' Set alert when security site opens ActiveX
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"
' Remove header and footer
strKeyPath = "Software\Microsoft\Internet Explorer\pagesetup\"
Objreg.setstringvalue HKEY_CURRENT_USER, strKeyPath, "header", ""
Objreg.setstringvalue HKEY_CURRENT_USER, strKeyPath, "footer", ""
msg = "IE security settings complete" &vbcrlf&vbcrlf
msg = MSG & "If you are not able to print properly, you need to close all open IE browser windows, and then log on to OA for printing" &vbcrlf&vbcrlf
msg = MSG & "If you still have a problem, you can contact the Technical Group: Liu Yong Law"
MsgBox msg, vbinformation, "Warm reminder!" "