View Single Post
  #4  
Old June 8th 09, 01:55 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Application.ActiveInspector().CurrentItem Returns Wrong(Old) Value

That depends on whether or not you intend to use any references to that item
again. If you call Marshal.ReleaseComObject() on it that will release the
item's RCW and unless you re-instantiate another object on that item any
further references to it will return an exception.

At some point the object reference should be released, but when depends on
any further need for it.

--
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


"Deepak N" endeep123[at]gmail[dot]com wrote in message
...
Thanks for reply.
Is it necessary release a COM Object, if a COM object is passed as
parameter to a method.

Ex: PrintName(ContactItemClass contact)
{
Console.WriteLine(contact.FirstName);
//Is it necessary to call Marshal.ReleaseComObject(contact) here
}. Submitted using http://www.outlookforums.com


Ads