I am trying to use the Outlook 2016 command line switch "/altvba
" to start Outlook with its "VbaProject.OTM" macro file in a non-standard location instead of "%appdata%\Microsoft\Outlook", but it does NOT work. When I try to use it, I receive an error message that this switch is not valid.
Correct, you can start Outlook using the /altvba switch to use a different VBA project file... but before you use use the switch, you need to set a registry key to enable this capability.
To use this switch, open the Run command by pressing Windows key + R then type outlook /altvba and the path to the alternate VBA file. You'll need to use double quotes around the path if the path contains spaces. Examples:
outlook /altvba C:\Users\slipstick\AppData\Roaming\Microsoft\Outlook\New.OTM
outlook /altvba "C:\Users\slipstick\Documents\VbaProject.OTM"
The project name is visible in the VBA Editor, but not the full path to the file. Note: if you use VBAProject as the file name (but in a different path), you'll only see the project name, not the full path to the file.
HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Security DWORD: EnableAltVba Value: 1
HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Outlook\Security DWORD: EnableAltVba Value: 1
HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Outlook\Security DWORD: EnableAltVba Value: 1