Erik Sondergaard
Posts: 2
Joined: 2005-08-29
|
Hi,
When i use this code, at click button event in a inspector on a reply item.
The outlook process hangs when i close it. if you try the same at new mailitem the process dose not hang?!
code:
Dim mail As Outlook._MailItem = Nothing
Try
If TypeOf (OutlookHost().ActiveInspector.CurrentItem) Is Outlook._MailItem Then
mail = CType(OutlookHost().ActiveInspector.CurrentItem, Outlook._MailItem)
mail.DeleteAfterSubmit = False
mail.Send()
End If
Finally
If Not mail Is Nothing Then
Marshal.ReleaseComObject(mail)
End If
End Try
|
|
Sergey Grischenko
Add-in Express team
Posts: 7233
Joined: 2004-07-05
|
Hi Erik.
Try to change the code:
Dim mail As Outlook._MailItem = Nothing
Dim olInsp As Outlook._Inspector = Nothing
Dim olItem As Object = Nothing
Try
olInsp = OutlookHost().ActiveInspector;
If Not olInsp Is Nothing Then
olItem = olInsp.CurrentItem;
If TypeOf (olItem) Is Outlook._MailItem Then
mail = CType(olItem, Outlook._MailItem)
mail.DeleteAfterSubmit = False
mail.Send()
End If
End If
Finally
If Not olItem Is Nothing Then
Marshal.ReleaseComObject(olItem)
End If
If Not olInsp Is Nothing Then
Marshal.ReleaseComObject(olInsp)
End If
mail = Nothing;
End Try
|
|
Erik Sondergaard
Posts: 2
Joined: 2005-08-29
|
Hi, I tried with youre code and got the same result on a replyitem. Outlook hangs when closing the app. Now it also hangs on new mail..
I have a small test if you want.
I´m using outlook2003
Kind Regaards
Erik |
|
Sergey Grischenko
Add-in Express team
Posts: 7233
Joined: 2004-07-05
|
Hi Erik.
I have just tested the code and it works fine on my PC. You can send me your code. I will test it. |
|