Thanks for replay,
After calling to Delete() method does pointer to mailItem still remain?, suppose i call to Delete() in mailItem that exists in Recycle folder.
TNX.
On Jan 23, 8:38 pm, "Ken Slovak - [MVP - Outlook]" <kenslo...[ at ]mvps.org> wrote:
[Quoted Text] > You should always release objects when done with them. I'd put the nulling > of the object before calling to release the COM object though. I don't see > any need for DoEvents given the code you showed. > > -- > 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> > "j" <Evgeny...[ at ]gmail.com> wrote in messagenews:1169572677.767918.228020[ at ]s48g2000cws.googlegroups.com... > > > > > Hi, > > > While i delete MailItem ( myMailItem.Delete() ) should i also call > > ReleaseComObject, > > and is it good idea to call Application.DoEvents after deleting item?? > > > please review the code snippets: > > > ............... > > .......... > > ............ > > mailItem.Delete(); > > Application.DoEvents(); > > > Marshal.ReleaseComObject(mailItem); > > mailItem = null; > > > ..................... > > ............................. > > > is it right way ??? > > > TNX in advance;- Hide quoted text -- Show quoted text -
|