Hi,
I am doing a drag drop of an outlook item to my VB.Net form. Once I have dropped the mail item i am releasing the objects using the below code:
This is in the dragdrop event of the form:
I am able to get the selected mail item details. But once the mail item is selected, the mail item is locked and not getting released till the application is closed. Can anybody help in this context?Code:outlook = CType(Microsoft.VisualBasic.Interaction.GetObject("", "Outlook.Application"), Outlook.Application) Dim explorer As Outlook.Explorer = outlook.ActiveExplorer Dim outlook As Outlook.Application Dim selection As Outlook.Selection = TryCast(explorer, _ Outlook._Explorer).Selection Dim mailItem As Outlook._MailItem = _ TryCast(selection.Item(1), Outlook._MailItem) System.Runtime.InteropServices.Marshal.ReleaseComObject(explorer) explorer = Nothing System.Runtime.InteropServices.Marshal.ReleaseComObject(selection) selection = Nothing System.Runtime.InteropServices.Marshal.ReleaseComObject(outlook) outlook = Nothing System.Runtime.InteropServices.Marshal.ReleaseComObject(mailItem) mailItem = Nothing GC.Collect() GC.WaitForPendingFinalizers() GC.Collect() GC.WaitForPendingFinalizers()




