Copy codeThe Code is as follows: '/* =================================================== ==========================================
'* Intro mainly solves the problem of setting IE Security before WebBrowser printing.
'* FileName: add the website to the secure site. Set the prompt when the secure site opens ActiveX. Go to the header and footer. vbs
'* Author yongfa365
'* Version v1.0
'* Email yongfa365 [at] qq.com
'* MadeTime 23:12:55
'* LastModify 23:12:55
'* ===================================================== ============================================= */
Const HKEY_CURRENT_USER = & H80000001
Set objReg = GetObject ("winmgmts: {impersonationLevel = impersonate }! \. \ Root \ default: StdRegProv ")
'Add a website to a secure website
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
'Prompt when setting Security site to open 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"
'Cancel the 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
Msg = msg & "if it cannot be printed properly, you need to close all open IE browser windows, and then log on to OA to print" & vbCrLf
Msg = msg & "if the problem persists, contact the technical team: Liu yongfa"
MsgBox msg, vbInformation, "Warm Reminder! "