Noname > 15-08-10, 01:40 PM
[HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Access\Security]
"Level"=dword:00000001
x_vananh_x > 27-05-11, 07:41 PM
khaccuong > 30-05-11, 12:59 PM
lehongduc > 24-09-17, 12:58 PM
Option Explicit
Type SYSTEM_INFO
wProcessorArchitecture As Integer
wReserved As Integer
dwPageSize As Long
lpMinimumApplicationAddress As Long
lpMaximumApplicationAddress As Long
dwActiveProcessorMask As Long
dwNumberOrfProcessors As Long
dwProcessorType As Long
dwAllocationGranularity As Long
wProcessorLevel As Integer
wProcessorRevision As Integer
End Type
Declare Sub GetNativeSystemInfo Lib "kernel32" (lpSystemInfo As SYSTEM_INFO)
Declare Function GetCurrentProcess Lib "kernel32" () As Long
Public Function Is64BitProcessor() As Boolean
Const PROCESSOR_ARCHITECTURE_AMD64 As Integer = 9
Const PROCESSOR_ARCHITECTURE_IA64 As Integer = 6
Dim si As SYSTEM_INFO
GetNativeSystemInfo si
Is64BitProcessor = (si.wProcessorArchitecture = PROCESSOR_ARCHITECTURE_AMD64 Or si.wProcessorArchitecture = PROCESSOR_ARCHITECTURE_IA64)
End Function
Sub RegKeySave(i_RegKey As String, i_Value As String, Optional i_Type As String = "REG_SZ")
'i_Type có các giá trị sau đây chỉ thị kiểu giá trị của khóa Registry:
'REG_SZ
'REG_DWORD
'REG_EXPAND_SZ
'REG_BINARY
Dim myWS As Object
Set myWS = CreateObject("WScript.Shell")
myWS.RegWrite i_RegKey, i_Value, i_Type
Set myWS = nothing
End Sub
Function SetSecurityLevel(vLevel As Integer)
'With Windows 64-bit
'HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Office\11.0\Access\Security\Level
'
'With Windows 32-bit
'"HKEY_LOCAL_MACHINE\Software\Microsoft\Office\11.0\Access\Security\Level"
'
'Value Set:
'0= very high
'1 = low
'2= medium
'3=high
Dim vSt As String
vSt = "0000000" & vLevel
If Is64BitProcessor() = True Then
RegKeySave "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Office\11.0\Access\Security\Level", vSt, "REG_DWORD"
Else
RegKeySave "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\Access\Security\Level", vSt, "REG_DWORD"
End If
End Function
hoaqldd33 > 14-07-18, 08:14 PM
ngochuong279 > 15-10-20, 09:54 AM