Connect to Outlook Desktop Application

Connects to the Outlook desktop application.

Important:Starting from IBM RPA 23.0.10, this command is deprecated. Use the Connect to Microsoft Outlook command instead.

Migrating to Microsoft™ Outlook web

Following this command's deprecation on version 23.0.10, you need to migrate all your bots and resources that connect to the Microsoft™ Outlook desktop application to the Microsoft™ Outlook web version. See the following procedure to migrate your existing scripts:

  1. Add a connection to the Microsot™ Outlook Email application. Refer to Adding connections to an application for further instructions.
  2. Check your published scripts for the deprecated outlookConnect command, and replace it with the Connect to Microsoft™ Outlook (microsoftMailConnect) command.
  3. In the command's input parameter, select the connection that was created in step 1.
  4. In the command's output parameter, you can use the same Email connection variable used before or create a new one.
  5. Click Save.
  6. Save and publish the script.
Important:Ensure to update the script version on any IBM RPA resource that references either the script or the script's version.

Command availability: IBM RPA SaaS and IBM RPA on premises


Connects to the Outlook desktop application and stores the established connection in a variable.

Script syntax

IBM RPA's proprietary script language has a syntax similar to other programming languages. The script syntax defines the command's syntax in the script file. You can work with this syntax in IBM RPA Studio's Script mode.

outlookConnect --mailusername(String) [--mailpassword(String)] [--enableLog(Boolean)] (EmailConnection)=value


  • The Outlook desktop application must be installed and running so the connection can be established.
  • If you want to access shared mailboxes that the connection's account have access to, you must use the Apply search filters (emailapplysearchfilter) command and enter the shared mailbox email in a List<text> variable in the Search in Mailboxes (N/A for IMAP) parameter.
  • Ensure that you have installed the 64-bit version of the Outlook application.

Input parameters

The following table displays the list of input parameters available in this command. In the table, you can see the parameter name when working in IBM RPA Studio's Script mode and its Designer mode equivalent label.

Designer mode label Script mode name Required Accepted variable types Description
Email mailusername Required Text Email address to connect to the desktop application.
Password mailpassword Optional Text Password of the email address to use for the connection.
Enable log enableLog Optional Boolean Enables protocol logging, if available.

The log file is stored in the %localappdata%\IBM Robotic Process Automation directory.

Output parameters

Designer mode label Script mode name Accepted variable types Description
Connection value Email Connection Collection containing all messages from the account's email boxes.


Connects to the Outlook desktop application.

defVar --name emailConnection --type EmailConnection
outlookConnect --mailusername "" --mailpassword userpassword --enableLogemailConnection=value
emailDisconnect --connection ${emailConnection}
// Connects to an Outlook desktop application and ends the connection.


  • The command fails if the Outlook desktop application is closed.
  • The command might not work properly if you are using a 32-bit version of Outlook desktop application.