A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

ItemAdd in Deleted Items event doesnt fire after a while



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 5th 07, 07:33 AM posted to microsoft.public.outlook.program_addins
[email protected]
external usenet poster
 
Posts: 1
Default ItemAdd in Deleted Items event doesnt fire after a while

I'm having this problem where i can't find a solution on my own and
neither can i find and posted solution around the web or forums. The
scenario is this : In order to trace the deleted items, i had added an
ItemAdd event on the deleted items folder to handle the entryid of the
deleted items. Well, it works in the beginning, but somehow i observed
this, after a while, specifically after i deleted a few of them and
after that added a few of them, it no longer handle the ItemAdd of the
deleted items folder. This is strange, and i need urgent help. Thanks.

Ads
  #2  
Old January 5th 07, 05:27 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default ItemAdd in Deleted Items event doesnt fire after a while

This is an indication that you are not storing the Items collection in a
variable that stays referenced. As soon as the GC kicks in, the intermediate
variable is released and you no longer received events.


Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


wrote in message
ups.com...
I'm having this problem where i can't find a solution on my own and
neither can i find and posted solution around the web or forums. The
scenario is this : In order to trace the deleted items, i had added an
ItemAdd event on the deleted items folder to handle the entryid of the
deleted items. Well, it works in the beginning, but somehow i observed
this, after a while, specifically after i deleted a few of them and
after that added a few of them, it no longer handle the ItemAdd of the
deleted items folder. This is strange, and i need urgent help. Thanks.



  #3  
Old January 5th 07, 09:28 PM posted to microsoft.public.outlook.program_addins
SHUperb
external usenet poster
 
Posts: 7
Default ItemAdd in Deleted Items event doesnt fire after a while

hmm..great. But frankly, I must first apologize because I'm a starter,
and I don't really understand by what you mean of storing the items
collection in a variable that stays referenced. On top of that, how do
I implement that? Please tolerate my incompetencies. Thank you very
much. I deeply appreciate your technical advice.

  #4  
Old January 5th 07, 11:22 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default ItemAdd in Deleted Items event doesnt fire after a while

You probably have something like

MAPIFolder.Items.ItemAdd += new ...

but it must be

m_Items = MAPIFolder.Items; //must be a class rather than a local variable
m_Items.ItemAdd += new ...

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"SHUperb" wrote in message
oups.com...
hmm..great. But frankly, I must first apologize because I'm a starter,
and I don't really understand by what you mean of storing the items
collection in a variable that stays referenced. On top of that, how do
I implement that? Please tolerate my incompetencies. Thank you very
much. I deeply appreciate your technical advice.



  #5  
Old January 6th 07, 08:47 AM posted to microsoft.public.outlook.program_addins
SHUperb
external usenet poster
 
Posts: 7
Default ItemAdd in Deleted Items event doesnt fire after a while

I think I did the right one on this. I declare it as a class like how u
put it

myFolders = MAPIFolder....
myItems = myFolders.Items;
myItems.ItemAdd += new ...

but i still face the problem. Any other idea how to solve this?

  #6  
Old January 6th 07, 04:17 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default ItemAdd in Deleted Items event doesnt fire after a while

Show more of your code.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"SHUperb" wrote in message
oups.com...
I think I did the right one on this. I declare it as a class like how u
put it

myFolders = MAPIFolder....
myItems = myFolders.Items;
myItems.ItemAdd += new ...

but i still face the problem. Any other idea how to solve this?



  #7  
Old January 7th 07, 02:44 AM posted to microsoft.public.outlook.program_addins
SHUperb
external usenet poster
 
Posts: 7
Default ItemAdd in Deleted Items event doesnt fire after a while

public void OnStartupComplete(ref System.Array custom)
{

myNamespace = applicationObject.GetNamespace("MAPI");
myFolder =
myNamespace.GetDefaultFolder(OlDefaultFolders.olFo lderCalendar);
myItems = myFolder.Items;

myDNamespace = applicationObject.GetNamespace("MAPI");
myDFolder =
myDNamespace.GetDefaultFolder(OlDefaultFolders.olF olderDeletedItems);
myDItems = myDFolder.Items;

try
{
myItems.ItemAdd += new
Microsoft.Office.Interop.Outlook.ItemsEvents_ItemA ddEventHandler(myItems_ItemAdd);
myItems.ItemChange += new
Microsoft.Office.Interop.Outlook.ItemsEvents_ItemC hangeEventHandler(myItems_ItemChange);
myItems.ItemRemove += new
Microsoft.Office.Interop.Outlook.ItemsEvents_ItemR emoveEventHandler(myItems_ItemRemove);
myDItems.ItemAdd += new
Microsoft.Office.Interop.Outlook.ItemsEvents_ItemA ddEventHandler(myDItems_ItemAdd);
}
catch (System.Exception ex)
{
MessageBox.Show(ex.Message);
}
}

  #8  
Old January 7th 07, 09:11 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default ItemAdd in Deleted Items event doesnt fire after a while

Are you sure you never set myDItems to null?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"SHUperb" wrote in message
ps.com...
public void OnStartupComplete(ref System.Array custom)
{

myNamespace = applicationObject.GetNamespace("MAPI");
myFolder =
myNamespace.GetDefaultFolder(OlDefaultFolders.olFo lderCalendar);
myItems = myFolder.Items;

myDNamespace = applicationObject.GetNamespace("MAPI");
myDFolder =
myDNamespace.GetDefaultFolder(OlDefaultFolders.olF olderDeletedItems);
myDItems = myDFolder.Items;

try
{
myItems.ItemAdd += new
Microsoft.Office.Interop.Outlook.ItemsEvents_ItemA ddEventHandler(myItems_ItemAdd);
myItems.ItemChange += new
Microsoft.Office.Interop.Outlook.ItemsEvents_ItemC hangeEventHandler(myItems_ItemChange);
myItems.ItemRemove += new
Microsoft.Office.Interop.Outlook.ItemsEvents_ItemR emoveEventHandler(myItems_ItemRemove);
myDItems.ItemAdd += new
Microsoft.Office.Interop.Outlook.ItemsEvents_ItemA ddEventHandler(myDItems_ItemAdd);
}
catch (System.Exception ex)
{
MessageBox.Show(ex.Message);
}
}



  #9  
Old January 8th 07, 02:05 AM posted to microsoft.public.outlook.program_addins
SHUperb
external usenet poster
 
Posts: 7
Default ItemAdd in Deleted Items event doesnt fire after a while

Nope. I did not set any null at anywhere of the whole code.

  #10  
Old January 8th 07, 03:57 AM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default ItemAdd in Deleted Items event doesnt fire after a while

You might want to create a small sample add-in that does nothing but monitor
ItemAdd event for the Deleted Item folder and post its source in this
newsgroup (if the problem still manifests itself).

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"SHUperb" wrote in message
oups.com...
Nope. I did not set any null at anywhere of the whole code.



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ItemAdd in Deleted Items event doesnt fire after a while SHUperb Outlook - Calandaring 0 January 5th 07 07:41 AM
How to fire NewMail&NewMailEx Event? baryon Outlook - General Queries 0 August 17th 06 04:31 PM
ItemAdd event with Outlook2007 DavidH&P Outlook - Using Forms 2 July 4th 06 08:29 AM
How to put the EventHandler ItemAdd to all open Deleted Items Folder's Ralf Preis Outlook and VBA 1 May 18th 06 04:35 PM
script event does not fire urs Outlook - General Queries 2 March 1st 06 04:55 PM


All times are GMT +1. The time now is 09:09 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.