Thread: Deleted Items
View Single Post
  #9  
Old March 7th 06, 11:32 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Deleted Items

Well, I'm sorry to tell you nothing really looks wrong in your code

The only thing I can think of and it's a stretch, is that you might try
getting each component object as a separate object instead of using dot
operators, where Outlook always creates internal variables. So for example
set a NameSpace object and use that to call the GetItemFromID method. Also
see if you are doing anything further on in that code that might call a
procedure or item method that somehow might also be creating an implicit
object variable that isn't being released when expected.

I'd also be curious to see if you put up some button or something and waited
a while, like 5 minutes, before clicking it and seeing if the GetItemFromID
code worked then. Just for testing of course.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Rog" wrote in message ...
Thanks Ken for your help on this.
Only problem is I do not maintain a reference to this contact until I am
trying to find it when the button is clicked:
I use this code to get the object:
object item = this.OutlookApp.GetNamespace("MAPI").GetItemFromID (entryID,
storeID);
but I do not maintain a reference to item outside of this function call.

If I get the item as above and then call:
System.Runtime.InteropServices.Marshal.ReleaseComO bject(item);
GC.Collect();
GC.WaitForPendingFinalizers();

it does not seem to do anything about releasing the cache.
Any ideas?
Thanks so much as always


Ads