Outlook email retrieve errors
Hi, I'm exploring how to search email in Pega Robotic Automation Studio, but I'm stuck at the beginning step, please help. I have 1000+ unread emails in my Outlook Inbox, is there any impact due to this? I'm sure i have install the corresponding office version dll. i can use Outlook to send email in Pega..
Error information for your reference
Unable to cast COM object of type 'System.__ComObject' to event interface type 'Microsoft.Office.Interop.Outlook.ItemEvents_10_Event'. This operation failed because the QueryInterface call on the COM component for the interface with IID
please refer to the attachments for more details.
-
Like (0)
-
Hi grona,
I'm 100% sure that i have installed the right version. Because i can use outlook connector to send email in other automation. and i can also use excel connector.

I tried your exact automation and it works for me. In searching for that error message in Google I found this article - https://stackoverflow.com/questions/4656360/unable-to-cast-com-object-microsoft-outlook-c-sharp. This indicates that you might have encountered something other than a MailItem - I would put a Try .. Catch around the steps from your loop and see if it this happens all the time or only for specific items.

Thanks, Jeff. But in my automation, the error happens when go to email retrieve.

Hi WoodYang,
While looking for assistance on your query with sme's, the best advise was to have you raise an SR to troubleshoot the issue.
Do let us know the SR-ID here once you create an SR. It helps in tracking.
Thanks!
This helps you
https://stackoverflow.com/questions/4656360/unable-to-cast-com-object-microsoft-outlook-c-sharp

I have tried to get the count of the e-mails in a folder using method RetrieveEmail of MS Outlook Connector and getting the same error discussed above (Unable to cast COM object)
Below are the steps followed
Step 1: Success
Folder: Draft (Low in Volume and no sub-folders present)
Read Type: Unread
O/P: Count of emails retrieved
Step 2: Failure
Folder: Inbox(High in Volume and various sub-folders present)
Read Type: Unread
O/P: Error received(Unable to cast COM object)
Step 3: Failure
Folder: Draft (Low in Volume and no sub-folders present)
Read Type: All
O/P: Same error encountered
Deleted the RetrieveEmail automation block and applied the new automation block in same manner.
Step 4: Success
Folder: Draft (Low in Volume and no sub-folders present)
Read Type: All
O/P: Count of e-mail retrieved
For Inbox it is giving error consistently. Is it related to volume of the email present. However, I have tried with 2-3 sub-folders of Inbox as well which has low volume but still giving same error.
Automation code for each step is in attachment. Please suggest how to solve this error.

Hi Manish,
Which version are you using. I'm using 1084 and 1087, my issue is still not resolved.
But i have coded a C# script for instead this component.