Add a website to a secure site. Set the prompt when a secure site opens ActiveX. vbs code for removing the header and footer

Source: Internet
Author: User

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! "

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.