Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

COM Add-In (Outlook)

0 views
Skip to first unread message

Randy Byrne [MVP - Outlook]

unread,
Aug 30, 2002, 1:11:37 PM8/30/02
to
You can set a flag during ItemRemove and then look for the ItemAdd event on
the DeletedItems folder, but you should understand that this will only work
for soft deletes. Hard deletes (Shift + Delete) will not be captured. There
are also issues with ItemRemove firing consistently.

Take a look at the following KB article:

OL2002: ItemRemove Event Does Not Run in Some Scenarios
http://mvp.support.microsoft.com/default.aspx?scid=kb;en-us;Q291423

--
Randy Byrne, MVP - Outlook
http://www.microeye.com
Building Applications with Microsoft Outlook 2002 (MSPress - July 2001)
Building Applications with Microsoft Outlook 2000 (MSPress)
http://www.microeye.com/books
Micro Eye ZipOut 2002
http://www.microeye.com/zipout


"Avi" <avi...@yahoo.com> wrote in message
news:924001c25031$a28f6000$2ae2...@phx.gbl...
Question: In the ItemRemove() event in outlook, how do I
catch the item thats being deleted?
Thank you.


Avi

unread,
Aug 30, 2002, 2:48:48 PM8/30/02
to
Thanks for input so far.
But how do I know where the item was when I call the
itemAdd from another folder.
e.g. how do i know that the item that being passed to
deleted folder is from contact folder or from inbox???

>-----Original Message-----
>Question: In the ItemRemove() event in outlook, how do I
>catch the item thats being deleted?
>Thank you.
>.
>

Randy Byrne [MVP - Outlook]

unread,
Aug 30, 2002, 4:51:47 PM8/30/02
to
The Item is passed in the ItemAdd event for colDeletedItems, assuming that
colDeletedItems refers to the collection of Items on the Deleted Items
folder. Set a deleted flag that is specific to a folder:

Private Sub colContactItems_ItemRemove()
m_blnDeletedContact = True
End Sub

Private Sub colDeletedItems_ItemAdd(ByVal Item As Object)
On Error Resume Next
'Move default item back to Contacts
If m_blnDeletedContact And Item.MessageClass = "IPM.Contact" Then
Set objDestFolder = objNS.GetDefaultFolder(olFolderContacts)
Item.Move objDestFolder
m_blnDeletedContact = False
End If
End Sub


--
Randy Byrne, MVP - Outlook
http://www.microeye.com
Building Applications with Microsoft Outlook 2002 (MSPress - July 2001)
Building Applications with Microsoft Outlook 2000 (MSPress)
http://www.microeye.com/books
Micro Eye ZipOut 2002
http://www.microeye.com/zipout


"Avi" <agi...@itgny.com> wrote in message
news:aa0301c25055$e01f38e0$3bef2ecf@TKMSFTNGXA10...

0 new messages