Add folders to trusted locations from Office Button ➞ Access Options ➞ Trust Center ➞ Trust Center Settings ➞ Trusted Locations.
The entries are stored in the registry under the following keys (where N is the number of the Trusted Location, starting from 0).
The registry settings can be set on a per-user basis using Group Policy or a registry/reg batch file. You can also set registry keys using VBA within Access, but that will only work if the database is already in a trusted location.
Access 365/2016/2019: [HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Access\Security\Trusted Locations] [HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Access\Security\Trusted Locations\LocationN]
For each trusted folder an entry with following registry keys can be populated:
Path: Path of trusted location, ending with \ (reg_sz)
AllowSubfolders: Determines whether subfolders are trusted as well (0=No; 1=Yes) reg_dword.
Description: Optional text description (reg_sz).
Date: Date of last update.
You should not designate a public folder on a network share as a trusted location, apply appropriate NTFS permissions.
The location numbers are assigned in order when users manually trust a document, so when coding this, use a reasonably high location number like 30 or 35 rather than 1 or 2, just to avoid overwriting any existing Location.
Allow Office 365/2016/2019 to read \\server64\\foldershare\
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Access\Security\Trusted Locations] "AllowNetworkLocations"=dword:00000001
[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Access\Security\Trusted Locations\Location31] "Path"="\\\\server64\\foldershare\\" "AllowSubfolders"=dword:00000001
This can be applied with REG:
Set _reg=HKCU\Software\Microsoft\Office\16.0\Access\Security\Trusted Locations
Set _data=00000001
REG ADD "%_reg%" /f /v "AllowNetworkLocations" /t REG_DWORD /d "%_data%" Set _reg=HKCU\Software\Microsoft\Office\16.0\Access\Security\Trusted Locations\Location31
Set _data="\\\\server64\\foldershare\\"
REG ADD "%_reg%" /f /v "Path" /t REG_SZ /d "%_data%"
REG - Add a registry key
REGEDIT - Add a registry file
Compatibility Between the 32-bit and 64-bit Versions of Office 2016 - Microsoft.