cancel
Showing results for 
Search instead for 
Did you mean: 

Still "operation failed: An object could not be found" issue with Outlook VBO 10.2.2

YiniZhang
Level 3
Hi Eric @ewilson and all

we are not able to get the received emails from the subfolder of one of our shared mailboxes since the beginning of this month. We tried MS Outlook VBO 6.10.7 and the newest one 10.2.2 both and removed all the filter expressions. Getting emails from the inbox directly works, from the subfolder under the inbox however doesn't.
We already enabled the 
Use Cached Exchange Mode and Download shared folders

Blue Prism Version: v7.1.1
Outlook VBO versions: v6.10.7 & 10.2.2

Does anyone have a solution please? Many thanks.

35210.png35211.png
35212.png

Best Regards,
Yini​
14 REPLIES 14

ewilson
Staff
Staff
@Yini Zhang,

If you have v10.2.2 of the Outlook VBO then you also have access to the new Get Items in Folder action. Have you tried using it? If not, I would recommend that you do. It's much more flexible at retrieving mail from different folders. Just make sure to pay attention to the format of folder path input. From the screenshot, it looks like yours may be \\Posteingang\test2, but that depends on whether there's another level above Posteingang which isn't clear from the screenshot.

Cheers,
Eric​

YiniZhang
Level 3
@ewilson Thank you for your reply, Eric. "Posteingang" is exactly "inbox" in German.:) So I tried the Get Items in Folder just now and got this error instead:
35188.png

I also tried "\\[email-adress of the shared mailbox]\Posteingang\test2" and "\\[name of the shared mailbox](eg. 'DE-FM Dev', with and without single quote)\Posteingang\test2", unfortunately it didn't work either.

Secondly, were there any updates at the beginning of this month? "Move Item" from V6.10.7 seems to be not working as well.

Our purpose is to
      1. move the emails from the inbox of a shared mailbox to one of its subfolders and
      2. check afterwards by using Get Items in Folder of this subfolder and Collection Contains Value of Utility - Collection Manipulation, whether the target email is correctly moved.

Which action would you suggest for moving emails in our case? Move Item or Move Email to Inbox Sub Folder of v10.2.2 pls?
35189.png

BR,
Yini​

ewilson
Staff
Staff
@Yini Zhang,

​Have you tried restarting Outlook and Blue Prism and testing again? I've run several tests against shared mailbox folders (i.e. Inbox, Sent Items, and custom top-level folders), folders of the main mailbox (i.e. Inbox, Sent Items, and custom top-level folders), and subfolders of both. I haven't run into any issues with the Get Items in Folder action throwing exceptions about not being able to follow the path unless I gave it an invalid path. That could include misspellings or even the inclusion of extra whitespace in the name of a folder (ex. TestFolderX where X is actually a space).

Here's a view of one of my test machines and the folder structure:

35190.png
I'm able to pull data from these folders through paths such as \\ewilson@xyz.com\Inbox, \\ewilson@xyz.com\Inbox\Test Folder, \\ewilson@xyz.com\Inbox\Test123\Test222, \\Mailbox01\Inbox, \\Mailbox01\Inbox\TestFolder01, etc.

When you test, do you have Outlook up-and-running? If not, does your Outlook instance have multiple profiles or one single profile?

Regarding the Move Item action, it hasn't changed since v6.10.7 release of the VBO back in August.

Cheers,
Eric

YiniZhang
Level 3
@ewilson
Yes, we noticed that Outlook must be running during the process, otherwise the object could not be found.
We only have one profile in Outlook on this server which has the full permissions of the mentioned shared mailbox as owner. Still the object with the following paths (subfolder directly under inbox or sub- subfolder, eg. inbox\test2 and inbox\testVBO\testVBO1) could not be found, except once after I restarted the server and BP. Which means the space in the name of the shared mailbox is not the problem, the action with the same path as in the screenshot could run to the end sucessfully. But in most cases, we got the following error.
We got the same error by Move Item and Move Email to Inbox Sub Folder.
35191.png
35192.png35193.png35194.png
BR,
Yini

ewilson
Staff
Staff
@Yini Zhang,

A little clarification here. The format of the folder path with the actions Get Received Items (Basic) and Move Email to Inbox Subfolder is different from the format of the folder path for the actions Get Items in Folder and Move Item. For Get Received Items (Basic) and Move Email to Inbox Subfolder you just need to set the Subfolder input value to the name of the specific subfolder under Inbox. If you have nested subfolders, then you would enter Subfolder1\Subfolder2\..... So, based on your screenshots, you would set the value of Subfolder to test2 or testVBO\testVBO1, as examples, for either Get Received Items (Basic) or Move Email to Inbox Subfolder. Of course, you would also need to supply a value for the  Account Display Name.

The path format is different between the older actions and the newer Get Items in Folder and Move Item actions because those actions aren't hardcoded to work only with the Inbox or Sent Items folders.

For the newer functions, there is a change we could make as a debugging technique to try and figure out where the search is failing. It will require a few changes in the Global Code section and adding an additional namespace reference. If you're interested, let me know and I'll type up the steps.

Cheers,
Eric​

YiniZhang
Level 3
@ewilson
noticed, thank you for the clarification.
Yes please , it would be very helpful, since in our business scenarios we work with Outlook very often. We had a big problem with moving emails to one of the inbox sub folders with Move Email to another Mailbox (And Subfolders) in v6.10.5 by one running bot of us. The emails in the inbox could not be found and moved because the operation failed, even though one retry logic and a code stage for the Outlook (re-)connection were built on this page. The same emails however would be found and moved in the next bot running.

BR,
Yini​

ewilson
Staff
Staff
@Yini Zhang,

One of the easiest ways to debug Code stages is to use the .NET MesageBox object. That gives you the ability to pop-up a dialog where you can add information to give you an idea how things are progressing in your code, what paths the code takes, etc. To do this, you need to add a DLL reference and a namespace reference in the Code Options of the VBO Properties.

Open the Outlook VBO and then on the Initialize tab double click on the Note stage. This will bring up the VBO Properties dialog.
35198.png

Click on the Code Options tab. Under the External References section, add the following DLL: System.Windows.Forms.dll. Under the Namespace Imports section, add the following namespace entry: System.Windows.Forms. It should look something like this when you're done:
35199.png
Once you've done that, you now have access to the .NET MessageBox object. On the Global Code tab you can now add calls to MessageBox.Show() to help us understand where things are going awry. Here's an example:
35200.png
 
Here's what it will look like as you step through the process:
35201.png 
WARNING: Make sure you go back and remove all of the MessageBox entries before trying to run the process in production. Otherwise, your process will stop at each MessageBox.Show call and wait for someone to dismiss the messagebox by clicking the OK button.

Cheers,
Eric

YiniZhang
Level 3
@ewilson Thank you for the debugging steps in details. Here is the result:
The folder "\\DE-*** RPA Dev\inbox\testVBO\testVBO1" was located successfully at first and the bot kept running in the loop. After that, "\\DE-*** RPA Dev\inbox\testVBO\testVBO5" however could not be located. I changed the current value of Destination Folder to "****\testVBO1", which was indeed found successfuly. This time the same error again.
35202.png35203.png​BR,
Yini

ewilson
Staff
Staff
@Yini Zhang,

Very strange. It's almost as if the Namespace reference is being lost or corrupted somehow.​ 🤔 When trying to work with testVBO5 the first time, or testVBO1 the second time, are you seeing message boxes displayed telling you at what point the processing made it to before the exception was thrown?

-- EDIT --
One other thing you could try doing is adding these two lines to the start of the GetFolderFromPath function in the Global Code section.
olNamespace = Nothing
olNamespace = olApp.GetNameSpace("MAPI")​


Basically this refreshes the Namespace/MAPI reference.

Cheers,
Eric