OL does not delete my items

R

regify

Hello,

I currently do the following after pressing send:
- create a new e-mail
- change content from original e-mail and copy to new e-mail
- send new e-mail
- delete original e-mail

The deletion is the problem. I do it the following way (symbolic):

1. Item.Delete

2. Now I remember the ItemID

3. Later in a Timer event I continuously try to delete such mails from
basket:
Set MyItem = ConnectClass.VBInstance.Session.GetItemFromID(ItemID)
MyItem.Delete

On most standalone OL systems, the mail is removed completely. That is
ok. But on some systems (mostly OL 2007 connected to Exchange), the e-
mail still remains in basket even after calling MyItem.Delete multiple
times.
Now the most confusing behaviour: If I double-click open one of those
items in the basket, then close it, it will get removed by ghost hand.

I have Redemption Objects available (if this will be helpfull).

How to delete for sure?

Volker
 
K

Ken Slovak - [MVP - Outlook]

When a PST file is used the EntryID does not change when an item is deleted
or moved to another folder in that PST file. When an Exchange mailbox is
used the EntryID does get changed when an item is moved or deleted. That's
specific to the store provider and cannot be changed.

That's what causes your code to fail when used against an Exchange mailbox.

You can handle ItemAdd on the Deleted Items folder and get the subject of
your object before calling Delete() on it, then match the subject when the
ItemAdd event fires. That will work for you whether a PST file is used or an
Exchange mailbox.

If you want to use RDO objects on this you can set up an ItemRemove handler
for the RDOItems collection of your folder. You'd get the PR_INSTANCE_KEY
values for your items before deleting them and then compare that property
with the item passed to you in ItemAdd() in the RDOItems collection for the
Deleted Items folder to verify it's the same item.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top