I am concerned about whether the call to Close() is a synchronous or
asynchronous operation. If I am displaying an email, and I call the Close()
function, and it is asynchronous, I may be trying to Delete the item while it
is still being displayed.
The background for my question is that I have created a temporary folder
with an email in order to display it. I want to Close() the email and delete
the folder and the email. However, sometimes (not in all cases) the delete
operation fails with a permissions error. If I wait a while and then delete,
or step through this process in a debugger, it never fails. So, I was
wondering if Close() is actually an asynchronous operation. If so, is there
a way to know when it has completed?