I believe the second part of your script is causing the problem:
- Code: Select all
For Each objProcess in colProcessList
Set objOutlook = CreateObject("Outlook.Application")
this actually starts a new instance of Outlook and then immediately quits the new instance, and that could be problematic. Try disabling this section and see if if solves the problem.
I'm not knowledgeable on what the terminate command does in the last part. If it is a normal application shutdown request it would be ok. However, if it forces the process to terminate right away, that can cause problems regardless of whether ClearContext is running because Outlook might not have a chance to save any data it is in the middle of processing.