Hi Peter,
This is my second attempt to reply. I think I did something wrong and lost
the
last version. If it comes through twice, sorry.
Deletions occur as you describe when using a POP3 server.
When using IMAP, they occur differently. When something is
deleted (from inbox - say) it remains in the box and visible,
just displayed with strikethrough. If you explicitly move an
item to a 'deleted items' folder - either manually or
programmatically Outlook copies the item to the new folder and
leaves the original in the source folder (also displayed with
strikethrough). Items can be finally deleted by selecting
'Purge Deleted Messages' from the Edit menu. So, it seems
that items can exist in a 'Marked for Deletion' state. My
problem is to programmatically distinguish these from other
mail messages. For a while I thought that this distinction
might be inextricably internal to Outlook in some way, but I have since
tried using two computers, both logged in to the same IMAP
server and observed that an item 'deleted' on one machine
soon appears 'marked for deletion' on the other. There is
a RemoteStatus property on mail messages which includes
'marked for deletion' as one of its enumeration values. However,
I have always found this property to have the value zero.
I believe that Outlook Express and Outlook are different in their
handling of delete on IMAP folders. My query relates to Outlook.
I have found some discussion about the implementation of delete
with IMAP, and even macro code for changing it to the form you
describe. It can be accessed at
http://www.outlookcode.com/codedetail.aspx?id=427 which I
reached as the first hit on the Google query "site
utlookcode.com purge
imap"
I don't like the way it works - invoking the Purge Deleted Messages
automatically by burrowing though the commandbars structure.
Is there no way of performing 'Purge Deleted Messages' in a better
way through the automation interface? Nonetheless I have done
a version in C++ to execute the purge. It is only convenient to use
if the warning on permanent deletion is switched off, which I
regard as poor practice. If all else fails it provides me with
a work around, to get my program functioning. I would much prefer
to be able to just ignore the messages that were marked for deletion,
ideally using a folder items restrict operation.
Cheers
Bill