How to post a code? something is changed in this website. Whenever I am putting code, it goes in single line
'On Error Resume Next
CONST HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Office\12.0\Access\Security\Trusted Locations\"
strWriteLn = "C:\Program Files\Microsoft Office\"
strvalName = "Location"
intcount=1
Set Objshell = CreateObject("wscript.shell")
'------------------------------------------------------------------------------------------
Chk_N_Write_Line ( strWriteLn )
'------------------------------------------------------------------------------------------
Sub Chk_N_Write_Line ( strWriteLn )
objReg.EnumKey HKEY_CURRENT_USER, strKeyPath, arrSubKeys
For Each subkey In arrSubKeys
subkey1 = Replace (LCase(subkey), "location", "") 'Split(Subkey, "n")
Next
subkey1 = subkey1+intcount
strvalName = Left (strvalName,8) & subkey1
A = "HKEY_CURRENT_USER" & "\" & strkeypath & strvalName & "\Path"
objshell.regwrite A,strWriteLn, "REG_SZ"
End Sub
<message edited by MadForMsi on Monday, January 02, 2012 12:57 AM>