You need to have an antivirus software installed and up-to-date to have any hope of avoiding the object model guard without editing the registry. This will show in File > Options > Trust Center > Trust Center Settings > Programmatic Access.
If you don't have valid AV or still get the prompt. the following is from my article at https://www.slipstick.com/developer/change-programmatic-access-options/
You need to set these keys if antivirus is valid but you still get the dialog:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\16.0\Outlook\Security DWORD: ObjectModelGuard Value: 2
HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\16.0\outlook\security DWORD: PromptOOMSend Value: 2 DWORD: AdminSecurityMode Value: 3 DWORD: promptoomaddressinformationaccess Value: 2 DWORD: promptoomaddressbookaccess Value: 2
A ready to use reg key for Outlook 2016 and newer is here: https://www.slipstick.com/doit/ObjectModelGuard-2016.reg
-- Diane
Disclaimer: slipstick.com is a site I run as a Microsoft MVP and the content is much more accurate and relevant than a general internet search. While the site is in English, there are translations options under the search box.