Deleted Items
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
Ken Slovak - [MVP - Outlook] wrote:
Have you released all references to the original object and since you're
using .NET code also called Marshal.ReleaseCOMObject and called the
garbage collector? Outlook caches items and their properties and the
fact that things work if you close and restart Outlook makes it look
like it's a caching problem. As long as an item is cached it will return
its original properties back.
|