SoFunction
Updated on 2025-04-08

Add a website to a secure site. Set up a secure site and prompt when opening ActiveX. Go to the vbs code of the header and footer


'/*=========================================================================
' * Intro mainly solves the problem that when printing using WebBrowser, you must first set IE security.
' * FileName Add website to a secure site. Set up a secure site and prompt when opening ActiveX. Go to the header and footer.vbs
' * Author yongfa365
' * Version v1.0
' * Email yongfa365[at]
' * 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 website to a secure site
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\"
HKEY_CURRENT_USER, strKeyPath
HKEY_CURRENT_USER, strKeyPath, "http", 2

'Set up a secure site and prompts when opening ActiveX
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2"
HKEY_CURRENT_USER, strKeyPath, "CurrentLevel", "00000000"
HKEY_CURRENT_USER, strKeyPath, "1201", "00000001"

'Cancel header footer
strKeyPath = "Software\Microsoft\Internet Explorer\PageSetup\"
HKEY_CURRENT_USER, strKeyPath, "header", ""
HKEY_CURRENT_USER, strKeyPath, "footer", ""

msg = "IE security settings are completed"&vbCrLf&vbCrLf
msg = msg & "If you can't print normally, you need to close all open IE browser windows, and then log in to OA to print"&vbCrLf&vbCrLf
msg = msg & "If there is still a problem, you can contact the technical group: Liu Yongfa"
MsgBox msg, vbInformation, "Warm reminder!"