Getting error in Outlook mail message

Main.xaml (15.8 KB)

I am getting error in for loop while reading mails subject.
I have change the account email address. I am always getting pop up so i put code in catch block …can anyone help me to resolve this error.
Any suggestion to make code more standardizes



i guess some issue with studio , after closing and open it again it work fine.
Can anyone explain me how to use invoke code activity to achive the same mentoined in below link

i had a bit similar issue. When i read emails from outlook and try to access any of their properties the bot used to throw an error. so i had to close the outlook and read it again.
I found that this problem is occurring because the bot is not able to access the email properties, so to resolve this issue i have used the below solution.

So the solution i found is first we need to read all the emails and while reading it uncheck the “mark as read” box. After reading the emails just try to access any of it property for an example try to access it subject “string.isnullorEmpty(mail.subject.tostring)”. Put the above condition in a if loop and if it is able to access then use another read outlook mail activity and this time mark the unread emails as read(check the “mark as read” property) and then proceed to your main code. else kill the outlook and relaunch it and this time simply repeat the process until u could access the properties of the email.

I hope this solution might help you a bit.


1 Like