We use Redemption since many years. Since few days many of our clients have issues when they use our plugin for Outlook. We changed nothing in our app.
I did some traces and found that the line Set CourielOutlook = New Redemption.SafeMailItem
makes the app to crash. Events viewer show that the fault is in mso20win32client.dll
.
I tried to find the problem by create a simple app doing the same thing and there is no problem with this one!!?
I found that if I rename the original app with a new name (AddinOutlook.exe
to AddinOutlook2.exe
), the app doesn't crash anymore!
If I rename my simple app to AddinOutlook.exe
, it crashes!
I tried many things in Outlook (deleting and recreating the profile, deleting and recreating the account, uninstall and reinstall Office 365). The problem still there.
After deleting and recreating the profile, it works the first time, but after that never (except if I rename the exe).
Any idea?
Here is my simple test app:
Dim Outlook As Outlook.Application
Dim Item As Object
Dim Namespace As Object
Dim CourielOutlook As Object 'Redemption.SafeMailItem
Set Outlook = New Outlook.Application
If Not Outlook Is Nothing Then
On Error Resume Next
Err.Clear
Set Namespace = Outlook.GetNamespace("MAPI")
If Err.Number <> 0 Then
Call Namespace.Logon(vbNullString, vbNullString, False)
End If
If Err.Number = 0 Then
If TypeName(Outlook.ActiveWindow) = "Inspector" Then
Call AjouterElement(Outlook.ActiveInspector.CurrentItem)
Set CourielOutlook = New Redemption.SafeMailItem
CourielOutlook.Item = Outlook.ActiveInspector.CurrentItem
'...
ElseIf TypeName(Outlook.ActiveWindow) = "Explorer" Then
For Each Item In Outlook.ActiveExplorer.Selection
Set CourielOutlook = New Redemption.SafeMailItem
CourielOutlook.Item = Item
'...
Next
End If
End If
End If
Set Outlook = Nothing