cancel
Showing results for 
Search instead for 
Did you mean: 

Outlook VBO fails to move messages

StephenColeman
Level 4
Hi all,
Bit of a strange issue I'm hoping someone can help with.

We have a process that needs to move emails from the Inbox of a shared mailbox to a subfolder.  It works fine in our test environment, but although it will read the contents of the inbox in Production, it will not move the emails. Every case throws the same exception
ERROR: Internal : Could not execute code stage because exception thrown by code stage: The operation failed.

As far as I can tell there are no differences between the Digital Worker accounts being used (they are all set-up the same way, it's just our naming convention that differentiates between Production and Test), no difference with the access to the mailboxes, and we set our test mailbox up exactly the same as the Production mailbox with the folder to be moved to as a child of the Inbox:
27152.png
We are using the Outlook VBO from the DX, Outlook 365 and BP 6.7.2.

Thanks,
Steve

------------------------------
Stephen Coleman
Developer - Automation
Zurich
Europe/London
------------------------------
10 REPLIES 10

ewilson
Staff
Staff
Hello @StephenColeman,

On the runtime resources, where you're running this process in production, are they configured with Cached Exchange Mode enabled or disabled? If it's enabled, do you also have the Download Shared Folders option checked?​

27085.png
Cheers,

------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Hi Eric,
Cached Exchange Mode is enabled, but I don't have the Download Shared Folders option checked.

27087.png
I'll check that and re-run the process to see if that makes a difference.

Thanks,



------------------------------
Stephen Coleman
Developer - Automation
Zurich
Europe/London
------------------------------

Hi,

Unfortunately, that hasn't made a difference. 😞 



------------------------------
Stephen Coleman
Developer - Automation
Zurich
Europe/London
------------------------------

Hi @StephenColeman,

Ok. The other option is to try disabling Cached Exchange Mode and see if that has an impact. It's weird, but in some cases using it helps while in others having it turned off seems to work better. Just make sure that after you uncheck the option you need to restart Outlook.

Also, can you paste the complete name of the shared folder you're trying to move items to? I want to see if I can recreate the behavior in our test environment.

Cheers,


------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Hi Eric,

Thanks for getting back to me again.  Unfortunately that setting is not something I can change.

These are the  screenshots of the folder for you:
Full Name is "Subfolder Consumed"
27098.png

27099.png


This is the code of that action:
27100.png

Dim app = CreateObject("Outlook.Application")
Dim _nameSpace As Microsoft.Office.Interop.Outlook.NameSpace = app.GetNameSpace("MAPI")

Dim folder As Folder
Dim item = _nameSpace.GetItemFromID(Entry_ID)

If Shared_Mailbox <> "" Then
Dim recipient = _nameSpace.CreateRecipient(Shared_Mailbox)
recipient.Resolve()
If recipient.Resolved Then
folder = _nameSpace.GetSharedDefaultFolder(recipient, Outlook_Folder_ID)
Else
Dim ex1 As New System.Exception(VbCrlf + "Failed to resolve shared mailbox '" + Shared_Mailbox + "'.")
Throw ex1
End If
Else
If Account_Display_Name <> "" Then
Try
Dim aa As List(Of Account) = _nameSpace.Accounts.Cast(Of Account).ToList()
folder = aa.Where(Function(x) x.DisplayName = Account_Display_Name).FirstOrDefault().DeliveryStore.GetDefaultFolder(Outlook_Folder_ID)
Catch ex As System.Exception
Dim ex1 As New System.Exception(VbCrlf + "Failed to retrieve default folder for Account Display Name '" + Account_Display_Name + "'." + VbCrlf + ex.Message)
Throw ex1
End Try
Else
folder = _nameSpace.GetDefaultFolder(Outlook_Folder_ID)
End If
End If

If Destination_Folder <> "" Then
For each name as string in Destination_Folder.Split("\")
Try
folder = folder.Folders(name)
Catch ex As System.Exception
Dim ex1 As New System.Exception(VbCrlf + "Failed to locate folder '" + name + "'." + VbCrlf + ex.Message)
Throw ex1
End Try
Next
End If

New_Entry_ID = item.Move(folder).EntryID

FYI, the folder that does work in test is exactly the same name

27101.png
27102.png
Thanks,



------------------------------
Stephen Coleman
Developer - Automation
Zurich
Europe/London
------------------------------

@StephenColeman,

It looks like you may not have the latest version of the MS Outlook VBO from the DX. The ​Move Email to Inbox Sub Folder action was deprecated. It's been replaced by a simpler action called Move Item. You might want to give the newer action a try. It works specifically with folder paths (ex. \\GBZ_Robotics_TESTMAILBOX_RPA\Inbox) as opposed to the Display Name.

Cheers,

------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

@stephen Coleman - Were you able to resolve this issue ? Could you please let me know if you got any workaround on this issue. It would be really helpful!

@Eric Wilson - Even I'm facing the same issue as @StephenColeman mentioned.

However, I'm using the updated "Move Item" action as you suggested but still I'm facing the same issue when I'm moving the mails from one subfolder to another subfolder in the Shared Mailbox.

Could you please let us know what could be the reason for this issue?

BP Version: 6.10.4

ERROR: Internal : Could not execute code stage because exception thrown by code stage:
Error while trying to move item "xxxx (EntryID of the mail)". The operation failed.

Action used:

27116.png

​​Folder directory path mentioned as suggested:

27117.png
VBO downloaded from the DX Portal:

Downloaded VBO on : 17-Aug-22

27118.png



------------------------------
Ramaseshan Subramani
------------------------------

Hi Stephan,

Can you try clearing .ost files and check once mails are not selected within subfolder.


------------------------------
Joshna Dammala
RPA Developer
Asia/Kolkata
------------------------------

Hi @Ramaseshan Subramani,

Are you also trying to move items in a Shared Mailbox? As I asked Stephen, is your Outlook instance configured to use Cached Exchange Mode? If so, do you have the Download Shared Folders option checked?​

Cheers,

------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------