答案 0 :(得分:0)
感谢Tim Williams在上面的评论中,我能够获得一个VBA代码来添加/删除可以固定和解除项目的注册表项。
If RegKeyExists("HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Access\Security\Trusted Locations\BEApplication\") = False Then
' Code for adding registry key
Dim myWS As Object, strPath
strPath = <Folder Path>
Set myWS = CreateObject("WScript.Shell")
myWS.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Access\Security\Trusted Locations\BEApplication\Path",strPath,"REG_SZ"
Else
' Key exists - do nothing
End If