I've developed an Outlook 2003 addin with VSTO + VS 2008.
There is a VB 6 application which creates an instance of Outlook mail, attaches a document to it and shows this to user to send.
When user clicks "send" button the mail window freezes. It happens on production machines only.
The VB6 code is as follows:
Private Sub Command1_Click()
Dim objOlApp As New Outlook.Application
Dim objMailItem As Outlook.MailItem
Dim objAttachments As Attachments
Dim arrFilesToAttach(1) As String
Set objOlApp = New Outlook.Application
Set objMailItem = objOlApp.CreateItem(olMailItem)
Set objAttachments = objMailItem.Attachments
arrFilesToAttach(0) = Text1.Text
For l = 0 To 0
strTemp = arrFilesToAttach(l)
If strTemp <> "" Then
objAttachments.Add arrFilesToAttach(l)
End If
Next
objMailItem.Display True
Set objOlApp = Nothing
Set objMailItem = Nothing
Set objAttachments = Nothing
End Sub
To see if it's my addin is creating an issue. I created a simple outlook addin and added some File IO code to the startup event Inside try...catch block. I disabled previous addin and installed this new sample addin.
The result was surprising, the sample addin too, was creating the problem. It changes the LoadBehaviour in registry to 2 for the sample addin. The try...catch block is not catching the exception. I've added an handler for Appdomain's unhandledException, but that too, is not getting fired.
Please help... Thanks in Advance.