My REXX script processes a Microsoft Outlook folder. Randomly, I receive a syntax error trying to retrieve the body of an email. The dump of condition("O") is:
PROGRAM........C:\Documents and Settings\John Bodoh\my documents\imdb\testole.REX
MESSAGE........An unknown OLE error occured (HRESULT=80004005).
23 - body = mail_obj~body;
Running the script repeatedly will result in errors on different records and a different count of records. But, it seems to always be when getting the body of the email.
After much testing, I discovered that the error occurred mostly when something else was going on on the system. While the script is running (the Outlook folder I process has over 900 emails and it takes awhile for the program to run), if I start some other program (e.g., Freecell) or interact with another program (e.g., scrolling an editor) the errors will begin occurring. My program handles the errors by putting out a messsage and skipping the email. When I caused some other activity on the system, I would usually get three or four errors in a row. Then, when the other activity settled down, the errors would no longer be occurring.
I have included a stripped down version of my program that will reproduce the errors. However, as I was developing the stripped down version, the more I stripped it down, the less the errors would occur.
Originally, I thought it was an error in Outlook. I reproduced the program in VB and tried it as an outlook macro. I could not get the failure with the VB.
The system I am running on is a Dell dual processor running Windows XP professional. I am running ooREXX version 3.1.0.