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

Items events not fired



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 15th 08, 11:25 PM posted to microsoft.public.outlook.program_addins
Cedric
external usenet poster
 
Posts: 12
Default Items events not fired

Hello all,

As I've already read about this issue, I know the title of my post may have
made you grin.
My add-in needs to track the activity of some folders. I know that under
certain conditions, the Items events may not fire. This is why, in order to
avoid my objects references getting eaten by the GC, I have:
- recursively created a tree of objects named QFolderWatcher, whose purpose
is to watch the activity of the outlook folders tree (or at least part of the
tree)
- included 2 variables in this class, named MyFolders and MyItems. When
creating a new QFolderWatcher, I save in a private variable the MAPIFolder,
and then put (VB):
MyFolders = Folder.Folders
MyItems = Folder.Items

Both variables are declared WithEvents, and all my objects have cross
references with:
- QFolderWatcher.SubFolders =list(of QFolderWatcher) : the list of
QFolderWatchers watching the current folder's subfolders
- QFolderWatcher.Parent : the FolderWatcher that watches the MAPIFolder's
parent folder.

The strange thing is that both variables MyFolders and MyItems are created
and initialized at the same place, and my application receives events from
the folders, but nothing about its items.


Ads
  #2  
Old December 16th 08, 03:30 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Items events not fired

As you know, almost all the time this happens it's due to out of scope
objects or objects that have been garbage collected. No exceptions in your
code and if you step the code everything is instantiated and not Nothing?

Have you tried simplifying the code to handle only one folder and one Items
collection to make sure that works with how you're doing things?

What version of Outlook? What version of the PIA are you referencing? What
version of VS?

What code are you using, show a small piece that someone can look at for
your instantiations and for your adding event handlers and your event
handler signatures.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Cedric" wrote in message
...
Hello all,

As I've already read about this issue, I know the title of my post may
have
made you grin.
My add-in needs to track the activity of some folders. I know that under
certain conditions, the Items events may not fire. This is why, in order
to
avoid my objects references getting eaten by the GC, I have:
- recursively created a tree of objects named QFolderWatcher, whose
purpose
is to watch the activity of the outlook folders tree (or at least part of
the
tree)
- included 2 variables in this class, named MyFolders and MyItems. When
creating a new QFolderWatcher, I save in a private variable the
MAPIFolder,
and then put (VB):
MyFolders = Folder.Folders
MyItems = Folder.Items

Both variables are declared WithEvents, and all my objects have cross
references with:
- QFolderWatcher.SubFolders =list(of QFolderWatcher) : the list of
QFolderWatchers watching the current folder's subfolders
- QFolderWatcher.Parent : the FolderWatcher that watches the MAPIFolder's
parent folder.

The strange thing is that both variables MyFolders and MyItems are created
and initialized at the same place, and my application receives events from
the folders, but nothing about its items.



  #3  
Old December 16th 08, 04:42 PM posted to microsoft.public.outlook.program_addins
Cedric
external usenet poster
 
Posts: 12
Default Items events not fired

Hi Ken,

thanks for your help and sorry for bothering : the issue is actually closed.
A condition that never happened to be true, plus a mess in version management.
Events are fired correctly now. Thanks anyway!

Ced
 




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
Registering events on calendar items on startup Manish Add-ins for Outlook 4 May 12th 08 07:31 PM
How do I un-delete calendar events from my deleted items RRGamache Outlook - Calandaring 1 January 28th 08 07:47 PM
notes converted to 24hr events - multi day items discconnected Bill Outlook - Calandaring 5 January 3rd 08 10:35 PM
Explorer' Close event not fired j Add-ins for Outlook 9 April 2nd 07 02:24 PM
Hooking events for new items in a mail folder mika Outlook - Using Forms 0 February 17th 06 08:58 AM


All times are GMT +1. The time now is 08:24 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.