When running Get Outlook Mail Messages, the following error is encountered: The specified folder does not exist .
Issue Overview: When running Get Outlook Mail Messages, the following error is encountered: The specified folder does not exist
Root Cause: This occurs when the specified folder is not accessible to the Robot (user permissions) or for some reason the Robot cannot see it when interacting with Outlook.
Diagnosing / Resolving the Issue:
- Try enabling the Robot Diagnostic logs and gather the event viewer logs
- Enable the Robot Diagnostic logs
- Run the automation again
- Gather the application event viewer logs. (Event Viewer->Windows Logs->Application)
- The event viewer logs will contain a warning that most likely explains the issue.
- If slashes are used in the Folder field of the activity, make sure they are back slashes (i.e. “Inbox\Test”)
- Open Outlook and see if the folder is present. If it is not, then the folder needs to be added to Outlook for the activity to work. For info on how to add a shared inbox, see Open and Use A Shared Mailbox in Outlook
- If the folder exists in Outlook, right click it’s root folder and select properties.
- In the “Inbox Properties” window that opens, select permissions.
- Make sure that your user account is added to the list of users with permissions to the mailbox.
- Try running the following powershell commands. These are similar to the steps UiPath takes and can help determine if this is a configuration issue. Note, all these commands need to be ran in sequential order:
- Creates in outlook object that has access to the needed mailbox.
- Add-Type -AssemblyName Microsoft.Office.Interop.Outlook
- $outlook = New-Object -ComObject Outlook.Application
- $namespace = $outlook.GetNamespace('MAPI')
- The above command should not fail, so if it does, system libraries or powershell dependencies may be missing. Fix that issue before continuing.
- Verify that the Robot can “see” the mail account with the following powershell command. The mailbox name would be the users email address.
- $account = $namespace.Folders.Item('<mail box name>')
- If the above command errors out, it means the problem is not with UiPath. It could be a typo, or it could possible be that security policies are blocking applications from interacting with Outlook.
- Make sure that the specific folder in question is visible. For example, to see the folder “Inbox”, run the following powershell command
- $account.Folders.Item('Inbox').Name
- If the folder being accessed was “Inbox/Test”, then the following command would be used
- $account.Folders.Item('Inbox').Folders.Item(“Test”).Name
- The pattern continues for any subsequent folders. If the above commands fail, it means that Applications are being blocked from seeing the folders being accessed. Doublecheck folder permissions and contact your IT team.
- Make sure that the specific folder in question is visible. For example, to see the folder “Inbox”, run the following powershell command
- If all of the above powershell commands succeeded, open a ticket with UiPath so that it can be investigated further.