OLMAPI32.dll Access Violation - When using Outlook Redemption via Visual Studio

0

Running on Windows 10 with Office 2016

From VBA (MS Word):

Reference Redemption.dll

Running the following code will create a session and return the account name

    Dim r As New RDOSession

    r.Logon

    Debug.Print r.Accounts.Item(1).Name

    r.Logoff

    Set r = Nothing

From Visual Studio (VS) 2015 VB.NET project: (same for VS2010 and VS2013)

Reference Redemption.dll

Running the following code ...

    Dim sess As New Redemption.RDOSession

    sess.Logon()

    MessageBox.Show(sess.Accounts(1).Name)

    sess.Logoff()

...generates this exception when it tries to create the RDOSession object.

Exception thrown at 0x0F304797 (OLMAPI32.DLL) in RedemptionTest.exe: 0xC0000005: Access violation writing location 0x00000000.

The event log reports:

Faulting application name: RedemptionTest.exe, version: 1.0.0.0, time stamp: 0x587e37c6
Faulting module name: olmapi32.dll, version: 16.0.6965.6571, time stamp: 0x58606a5b
Exception code: 0xc0000409
Fault offset: 0x00134797
Faulting process id: 0x4ce0
Faulting application start time: 0x01d270d888a9b2ff
Faulting application path: C:\Redox\Test\RedemptionTest\RedemptionTest\bin\x86\Debug\RedemptionTest.exe
Faulting module path: C:\Program Files (x86)\Microsoft Office\Root\Office16\olmapi32.dll
Report Id: 7c4170c7-b227-4839-b956-3b51c52920c0
Faulting package full name:
Faulting package-relative application ID:

However, if I create an installation file for the VB project and install it on my machine, it will run the installed application and return the account name without any exceptions.

This used to work fine. I can't remember if it worked via VS after I installed Office 2016 and it certainly hasn't worked since upgrading to Win 10.

Any suggestions on how I can get it to work via VS? Many thanks.

Redemption Ver: 5.0

vb.net
visual-studio
outlook-redemption
asked on Stack Overflow Jan 17, 2017 by simpleman • edited Jan 17, 2017 by simpleman

1 Answer

0

As per Dmitry's comment:

Outlook 2016 C2R broke the way MAPI system is loaded - you need to have the latest version (5.12, or at least 5.11) to support Outlook 2016.

Installing and using Redemption 5.12 solves the issue with running from Visual Studio.

Thanks Dmitry.

answered on Stack Overflow Jan 17, 2017 by simpleman

User contributions licensed under CC BY-SA 3.0