The following VB code checks a list of mailboxes and mails me a message with the number of messages in each mailbox every 15 minutes. The works perfectly except for one problem. If I am composing an email or responding to one when the code kicks off, Outlook Freezes. I put in more DoEvents than code, I think. I also "instrumented" the code to write a log as it takes various steps. It consistently fails at the step indicated. Outlook issues no errors and I kill outlook with the windows task manager and I restart it and it restarts normally with no messages.
Log extract:
"11/21/2018 11:13:00 Initalizing Variables"
"11/21/2018 11:13:00 Initalizing Outlook"
"11/21/2018 11:13:00 Looping through folders"
"11/21/2018 11:13:00 Processing Amazon Daily Ops Reports"
"11/21/2018 11:13:00 Getting number of messages in Amazon Daily Ops Reports"
The issue is also discussed in this forum: https://www.utteraccess.com/forum/in...&#entry2705093
This is the code in the ThisOutlookSession Module. It doesn't seem to have a problem
Here is the complete rest of the code which is in a regular module. The mail workbook routine never crashes. The issue is with the Mail Alert routine.Please Login or Register to view this content.
Please Login or Register to view this content.
Bookmarks