Allow Programmatic Access to Outlook

Allow Programmatic Access to Outlook




Prepared by:

Paresh Parmar

Version:

1.0

Effective Date:

June 20, 2024







Allow Programmatic Access to Outlook

The MS Outlook library functions allow a robotic solution to read information from the Outlook application installed on the machine on which the robotic solution will be run.

However, Outlook security settings may block access to those functions. Depending on the version of Outlook installed, the message below might be displayed.



In other cases, the message will not be displayed but the functions will not be able to retrieve the information requested.

To enable the MS Outlook library functions to work as intended, you must enable programmatic access to Outlook on every machine on which the robotic solution will be run. There are two ways to do this:

  • By changing the security settings within Outlook Trust Center

  • By editing the registry

Depending on the corporate group policy applied, these options may not be available in which case it is necessary to automate the clicking of the Allow button in the message window displayed above.

Enable Programmatic Access through Outlook Trust Center

The simplest method to allow programmatic access to Outlook is through the Outlook Trust Center.

  1. Close Outlook if currently open.

  2. Run Outlook as an administrator.



  1. Select File Options Trust Center.

  2. Click Trust Center Settings.




Select Never warn me about suspicious activity. If this option is not available, try the alternative approach below.



  1. Click OK.

Enable Programmatic Access through the Registry

When corporate group policy prevents changing settings in the Outlook Trust Center, the alternative is to enable programmatic access to Outlook through the registry.

  1. Ensure that you have Administrator rights.

  2. Save the following text in a file with an extension .reg:

    Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\<Build Number>\Outlook\Security] "ObjectModelGuard"=dword:00000002

    Replace <Build Number> in the text above with the appropriate code for the version of Outlook in use as per the table below.



  1. Double-click the .reg file to add the entry to HKEY_LOCAL_MACHINE.

  2. Similarly, add the following to HKEY_CURRENT_USER:

    Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Policies\Microsoft\office\<Build Number>\Outlook\Security] "PromptOOMSend"=dword:00000002
    "AdminSecurityMode"=dword:00000003 "promptoomaddressinformationaccess"=dword:00000002 "promptoomaddressbookaccess"=dword:00000002
    

    Replace <Build Number> in the text above with the appropriate code for the version of Outlook in use as per the table shown previously.

Automate Enabling Programmatic Access to Outlook

If it is not possible, due to corporate group policy, to change settings in the Outlook Trust Center and through the registry, it is necessary to automate the response to the message below which is displayed when an MS Outlook library function attempts to retrieve information from Outlook.



The procedure for doing so is outline below.

  1. Capture the Allow button, the checkbox, and the drop-down list in this window as screen elements.

  2. Set up an event handler that will be activated when this window is displayed.

  3. When activated, the event handler should:

    1. Check the checkbox.

    2. Set the drop-down to 10 minutes.

    3. Click the Allow button.



    • Related Articles

    • How to Encrypt Email in Outlook & Office 365

      Prepared by: Paresh Parmar Version: 1.0 Effective Date: February 21, 2025 How to Encrypt Email in Outlook & Office 365 Email communication is a goldmine for cybercriminals, emphasising the need for Outlook and Microsoft 365 email encryption. Office ...
    • How to set the default signature in Outlook?

      Office 365 Email ID default signature in Outlook Standard Procedure Prepared by: Paresh Parmar Version: 1.0 Effective Date: June 14, 2023 From Windows Outlook Client In Outlook, select “File“ > “Options“. 2. Select “Mail” on the left, then click ...
    • Check spelling Enable In outlook before sending a message.

      In desktop versions of Outlook, you can check the spelling in your email message at any time by clicking Review > Spelling & Grammar. To keep the Spelling & Grammar command always within reach, you can add it to the Quick Access Toolbar If you don’t ...
    • step-by-step guide to help you set up and manage multiple email accounts in Outlook

      Prepared by: Paresh Parmar Version: 1.0 Effective Date: June 3, 2024 Managing multiple email boxes in Outlook can help you stay organized and efficient. Here's a step-by-step guide to help you set up and manage multiple email accounts in Outlook: ...
    • Office 365 Email ID Configuration Step by Step Guide.

      Office 365 Email ID Configuration Standard Procedure Prepared by: Paresh Parmar Version: 1.0 Effective Date: June 7, 2023 How to Setting up Outlook for the first time (Microsoft 365) Before using Outlook for the first time, you will need to add your ...