0

Since the migration to Microsoft Exchange Server 2013 my outlook 2010 add-In throws sporadically the exception 0x80040125 by invoking of mailitem.move().

I found out, that the exception occurs only when a re-connect to MS Exchange has been preceded (MAPI_E_RECONNECTED).

The whole problem is, that I have than to restart the add-in (alone or together with outlook) to get it works again.

Now I am looking for a solution to prevent the exception or a strategie to avoid the necessity of the restart.

creg
  • 154
  • 3
  • 13

1 Answers1

0

Take a look at the What is MAPI_E_RECONNECTED? article which explains what the 0x80040125 error code stands for. In short:

MAPI_E_RECONNECTED, aka 0x80040125, is returned by the Exchange Address Book and Message Store providers when the RPC connection token is discovered to be out of date. The connection token is basically a number tracking the current connection. If the token on our current transaction is different from the token on the connection, this means we have reconnected, so MAPI_E_RECONNECTED is returned. MAPI_E_RECONNECTED can be treated the same as MAPI_E_END_OF_SESSION and the call should be retried.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
  • thank you, I've read it already but it does not solve my problem (or I have misunderstood what I have to do to avoid that situation). **"and the call should be retried"** When I move the next mail item the same exception occurs. I think that is because I have some add-In global references (to com objects) that should be at first released and then referenced at new again. It is very difficult to me to test it, because the issue not appears regularly. – creg Feb 04 '16 at 10:43
  • **"and the call should be retried"**: I found out, that it is not sufficient to restart / reload the add-in. I have to restart my outlook completely. But ironically, outlook seems to work also without a restart. – creg Feb 08 '16 at 12:42