Outlook hangs

Add-in Express™ Support Service
That's what is more important than anything else

Outlook hangs
Outlook hangs when using reply 
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
Posted 29 Aug, 2005 09:50:33 Top
Sergey Grischenko


Add-in Express team


Posts: 7202
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
Posted 30 Aug, 2005 01:15:02 Top
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
Posted 30 Aug, 2005 03:16:43 Top
Sergey Grischenko


Add-in Express team


Posts: 7202
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.
Posted 31 Aug, 2005 14:33:26 Top